    /* Reset and Base Styles */
        
:root {
            --primary-color: #007bff;
            --light-gray: #f8f9fa;
            --medium-gray: #dee2e6;
            --dark-gray: #343a40;
            --success-color: #28a745;
            --white: #ffffff;
        }

* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        html, body {
            height: 100%; /* Ensure html and body take full viewport height */
            margin: 0;
            padding: 0;
            overflow: auto; /* Changed to auto to allow scrolling if content overflows */
        }
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f5f6fa;
            display: flex; /* Make body a flex container too, to ensure #container fills it */
            flex-direction: column; /* Stack children vertically */
        }


 /* --- Header Styles --- */
        #header {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background-color: var(--white);
            border-bottom: 1px solid var(--medium-gray);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 25px;
            box-sizing: border-box;
            z-index: 10;
        }

        .header-left { display: flex; align-items: center; gap: 15px; }
        .header-left .logo { height: 35px; }
        .header-left h1 { font-size: 1.25rem; margin: 0; color: var(--dark-gray); font-weight: 600; }
        .header-right .header-link { text-decoration: none; color: var(--primary-color); font-weight: 500; }

        #container {
            position: relative;
            width: 100%;
            max-width: none; /* Full width */
            margin: 0; /* No margin */
            background: #fff;
            border-radius: 0; /* No border-radius for full screen */
            box-shadow: none; /* No shadow for full screen */
            overflow-y: auto; /* Allow vertical scrolling within container if needed */
            flex-grow: 1; /* Allow container to fill remaining body height */
            display: flex;
            flex-direction: column;
        }
        #canvasContainer {
            position: relative;
            flex-grow: 1; /* Allows canvas to take available height */
            min-height: 0; /* Explicitly allow shrinking */
            background: linear-gradient(45deg, #f8f9fa, #e9ecef);
            display: flex;
            align-items: center;
            justify-content: center;
            border-bottom: 1px solid #eee;
        }
        #threejs-canvas {
            width: 100%;
            height: 100%;
            cursor: grab;
        }
        #threejs-canvas:active {
            cursor: grabbing;
        }
        /* 360 View Controls - HIDDEN */
        .view-controls {
            display: block; /* Hidden as per user request */
            position: absolute;
            top: 20px;
            left: 20px;
            flex-direction: column;
            gap: 10px;
            z-index: 110; /* Ensure controls are above canvas */
        }
        .view-control-btn {
            padding: 8px 12px;
            background: rgba(255,255,255,0.9);
            border: 1px solid #ddd;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.2s;
            backdrop-filter: blur(10px);
			margin-top:50px !important;
        }
        .view-control-btn:hover {
            background: white;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .view-control-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }
        .view-control-info {
            display: none; /* Hidden as per user request */
            padding: 8px 12px;
            background: rgba(255,255,255,0.9);
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 12px;
            color: #333;
            backdrop-filter: blur(10px);
            white-space: nowrap; /* Prevent text from wrapping */
        }
        /* Horizontal Footer Layout */
        .footer-layout-horizontal {
            display: flex;
            align-items: center;
            justify-content: space-between;
			z-index:1;
            padding: 10px 30px;
            background: #fff;
            border-top: 3px solid #667eea;
            flex-wrap: wrap;
            gap: 20px;
            min-height: 80px;
            flex-shrink: 0; /* Prevent footer from shrinking */
        }
        .footer-section {
            display: flex;
            align-items: center;
            gap: 15px;
        }
        /* Step Indicator Section */
        .footer-left {
            /* Removed min-width for better responsiveness */
            flex-shrink: 0; /* Prevent content from shrinking too much */
        }
        .step-indicator {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 14px;
            white-space: nowrap;
        }
        .step-description {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .step-description strong {
            color: #333;
            font-size: 14px;
        }
        .step-description small {
            color: #666;
            font-size: 12px;
        }
        /* Thumbnails Section */
        .footer-center {
            flex: 1; /* Allows it to grow and shrink */
            max-width: 400px;
        }
        .thumbnails-container {
            text-align: center;
        }
        .thumbnails-title {
            margin: 0 0 10px 0;
            color: #495057;
            font-size: 14px;
            font-weight: 600;
        }
        .thumbnails-horizontal {
            display: flex;
            gap: 15px;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap; /* Added flex-wrap for thumbnails */
        }
        .thumb {
            text-align: center;
            cursor: pointer;
            transition: transform 0.2s ease;
            padding: 5px;
        }
        .thumb:hover {
            transform: translateY(-2px);
        }
        .thumb.active {
            transform: scale(1.1);
        }
        .thumb img {
            width: 50px;
            height: 50px;
            border-radius: 8px;
            border: 2px solid #ddd;
            object-fit: cover;
            background: #f8f9fa;
            transition: border-color 0.2s ease;
            background-image: linear-gradient(45deg, #667eea20, #764ba220);
        }
        .thumb:hover img {
            border-color: #667eea;
        }
        .thumb.active img {
            border-color: #667eea;
            box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
        }
        .thumb span {
            display: block;
            font-size: 12px;
            margin-top: 4px;
            color: #666;
            font-weight: 500;
        }
        /* Action Buttons Section */
        .action-buttons {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
            justify-content: center;
        }
        .btn {
            padding: 10px 16px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            transition: all 0.2s ease;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }
        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .btn-primary {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
        }
        .btn-secondary {
            background: #f8f9fa;
            color: #495057;
            border: 1px solid #dee2e6;
        }
        .btn-success {
            background: linear-gradient(135deg, #28a745, #20c997);
            color: white;
        }
        .btn:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        .btn-icon {
            font-size: 12px;
        }
        /* Text Edit Overlay Styles */
        #textEditOverlay {
            position: absolute;
            top: 20px;
            right: 20px;
            transform: none;
            background: white;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.3);
            z-index: 1000;
            min-width: 300px;
            max-width: 380px;
            display: none;
        }
        #textEditOverlay.show {
            display: block;
        }
        #textEditOverlay h2 {
            margin: 0 0 20px 0;
            color: #333;
            text-align: center;
        }
        .control-group {
            margin-bottom: 15px;
        }
        .control-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 600;
            color: #555;
        }
        .control-group input,
        .control-group select,
        .control-group textarea {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }
        .control-group textarea {
            height: 80px;
            resize: vertical;
        }
        #doneTextEditBtn {
            width: 100%;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 12px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 20px;
        }
        /* Modal Styles */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            display: none;
            z-index: 2000;
            align-items: center;
            justify-content: center;
        }
        .modal.show {
            display: flex;
        }
        .modal-content {
            background: white;
            border-radius: 12px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 30px;
            border-bottom: 1px solid #eee;
        }
        .modal-header h2 {
            margin: 0;
            color: #333;
        }
        .close-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #999;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .modal-tabs {
            display: flex;
            border-bottom: 1px solid #eee;
        }
        .tab-btn {
            flex: 1;
            padding: 15px;
            border: none;
            background: none;
            cursor: pointer;
            font-weight: 600;
            color: #666;
        }
        .tab-btn.active {
            color: #667eea;
            border-bottom: 2px solid #667eea;
        }
        .tab-content {
            padding: 30px;
            display: none;
        }
        .tab-content.active {
            display: block;
        }
        .upload-area {
            border: 2px dashed #ddd;
            border-radius: 8px;
            padding: 40px;
            text-align: center;
            
			cursor: pointer;
            transition: border-color 0.2s;
            position: relative; /* For loading indicator */
            min-height: 150px; /* Ensure it has height for loading */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .upload-area:hover {
            border-color: #667eea;
        }
        .upload-area.dragover {
            border-color: #667eea;
            background-color: #f0f4ff;
        }
        .upload-icon {
            font-size: 48px;
            margin-bottom: 10px;
        }
        .upload-text {
            font-size: 18px;
            color: #333;
            margin-bottom: 5px;
        }
        .upload-subtext {
            color: #666;
            font-size: 14px;
        }
        .library-categories {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .category-btn {
            padding: 8px 16px;
            border: 1px solid #ddd;
            background: white;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }
        .category-btn.active {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }
        .image-library {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 15px;
            min-height: 200px;
        }
        .library-image {
            width: 100px;
            height: 100px;
            background: #f8f9fa;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.2s;
            border: 2px solid transparent;
            overflow: hidden;
        }
        .library-image:hover {
            transform: scale(1.05);
            border-color: #667eea;
        }
        .library-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .hidden {
            display: none !important;
        }

        /* Loading Indicator */
        .loading-indicator {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 10px;
            color: #667eea;
            font-weight: 600;
        }
        .spinner {
            border: 4px solid rgba(0, 0, 0, 0.1);
            border-top: 4px solid #667eea;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Custom Color Selector Styles */
        .color-selector-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .color-circle {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 2px solid #ddd;
            cursor: pointer;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .color-circle:hover {
            border-color: #667eea;
            box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        }
        .hidden-input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
            width: 1px;
            height: 1px;
        }

        /* Image Adjustment Tab Styles */
        #adjust-fit-tab .controls {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-top: 20px;
        }
        #adjust-fit-tab .control-group {
            margin-bottom: 0;
        }
        #cropPreviewContainer {
            width: 400px;
            height: 400px;
            border: 1px solid #ddd;
            overflow: hidden;
            margin: 0 auto 20px auto;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f8f8f8;
            border-radius: 8px;
            position: relative;
        }
        #cropPreviewImage {
            display: block;
            max-width: 100%;
            max-height: 100%;
        }
        #applyAdjustedImageBtn {
            width: 100%;
            background: linear-gradient(135deg, #28a745, #20c997);
            color: white;
            border: none;
            padding: 12px;
            border-radius: 6px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 20px;
            transition: all 0.2s ease;
        }
        #applyAdjustedImageBtn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .image-manipulation-controls {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
            margin-top: 15px;
        }
        .control-btn {
            flex-grow: 1;
            min-width: 80px;
            padding: 8px 12px;
            font-size: 13px;
        }
        .zoom-controls {
            display: flex;
            gap: 10px;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
        }
        .zoom-btn {
            padding: 8px 15px;
            font-size: 18px;
            font-weight: bold;
            border: 1px solid #ddd;
            background: #f8f9fa;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .zoom-btn:hover {
            background: #e9ecef;
            border-color: #667eea;
        }
        .zoom-value-display {
            font-weight: 600;
            color: #333;
            min-width: 60px;
            text-align: center;
        }

        /* Responsive Design */
        @media (max-width: 992px) {
            .footer-layout-horizontal {
                flex-direction: column;
                align-items: stretch;
                gap: 15px;
                padding: 20px;
            }
            .footer-section {
                justify-content: center;
            }
            .footer-left,
            .footer-right {
                min-width: auto;
            }
            .action-buttons {
                justify-content: center;
                flex-wrap: wrap;
            }
            #textEditOverlay {
                top: auto;
                bottom: 105px;
                left: 50%;
                transform: translateX(-50%);
                width: 90%;
                max-width: 400px;
                right: auto;
            }
            #cropPreviewContainer {
                width: 90%;
                max-width: 400px;
                height: auto;
                aspect-ratio: 1 / 1;
            }
        }
        @media (max-width: 768px) {
         


.footer-layout-horizontal {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding:60px;
        width: 100% !important;
position: relative; 
	bottom:6%;
			}

   #container {
                border-radius: 0;
                margin: 0;
            }
            .thumbnails-horizontal {
                gap: 10px;
            }
            .thumb img {
                width: 40px;
                height: 40px;
            }
            .action-buttons {
                flex-direction: column;
                width: 100%;
            }
            .btn {
                width: 100%;
                justify-content: center;
            }
            #textEditOverlay {
                width: 90%;
                min-width: auto;
                padding: 20px;
            }
        }





[type=button]:focus, [type=button]:hover, [type=submit]:focus, [type=submit]:hover, button:focus, button:hover {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: #fff !important;
    text-decoration: none;
}

.tab-btn.active {
     background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: #fff !important;
    text-decoration: none;
	border:none !important;
}


