:root {
            --primary: #9b59b6;
            --primary-dark: #8e44ad;
            --secondary: #2ecc71;
            --accent: #3498db;
            --warning: #f39c12;
            --danger: #e74c3c;
            --success: #27ae60;
            --dark: #2c3e50;
            --light: #ecf0f1;
            --gray: #7f8c8d;
            --light-gray: #bdc3c7;
            --border-radius: 18px;
            --shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
            --gradient: linear-gradient(135deg, #9b59b6, #3498db);
            --premium-gradient: linear-gradient(135deg, #f39c12, #e74c3c);
            --glass-bg: rgba(255, 255, 255, 0.95);
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Roboto', -apple-system, sans-serif;
            max-width: 100%;
        }
        
        html, body {
            overflow-x: hidden;
            min-height: 100vh;
            background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
            color: var(--dark);
        }
        
        .container {
            max-width: 1600px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        /* Glass Morphism Header */
        .glass-header {
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            color: var(--dark);
            padding: 35px 45px;
            border-radius: var(--border-radius);
            margin: 30px auto;
            box-shadow: var(--shadow);
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .glass-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: var(--premium-gradient);
        }
        
        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 25px;
        }
        
        .logo-section {
            display: flex;
            align-items: center;
            gap: 25px;
        }
        
        .logo-icon {
            width: 70px;
            height: 70px;
            background: var(--gradient);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            color: white;
            box-shadow: 0 8px 25px rgba(155, 89, 182, 0.3);
        }
        
        .logo-text h1 {
            font-size: 2.8rem;
            font-weight: 900;
            background: var(--gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1.1;
        }
        
        .premium-tag {
            background: var(--premium-gradient);
            color: white;
            padding: 10px 25px;
            border-radius: 30px;
            font-size: 1rem;
            font-weight: 800;
            display: inline-block;
            margin-top: 12px;
            box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
            letter-spacing: 0.5px;
        }
        
        .header-stats {
            display: grid;
            grid-template-columns: repeat(3, auto);
            gap: 30px;
            align-items: center;
        }
        
        .stat-badge {
            text-align: center;
            padding: 15px 20px;
            background: rgba(155, 89, 182, 0.05);
            border-radius: 15px;
            min-width: 120px;
        }
        
        .stat-value {
            font-size: 2.2rem;
            font-weight: 900;
            color: var(--primary);
            margin-bottom: 5px;
        }
        
        .stat-label {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--gray);
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        /* Main Layout */
        .main-layout {
            display: grid;
            grid-template-columns: 1.2fr 0.8fr;
            gap: 35px;
            margin: 45px 0;
        }
        
        /* Glass Cards */
        .glass-card {
            background: var(--glass-bg);
            backdrop-filter: blur(10px);
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            padding: 40px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
            position: relative;
            overflow: hidden;
        }
        
        .glass-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            transform: translateX(-100%);
            transition: transform 0.6s;
        }
        
        .glass-card:hover::before {
            transform: translateX(100%);
        }
        
        .glass-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
        }
        
        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 35px;
            padding-bottom: 25px;
            border-bottom: 2px solid rgba(155, 89, 182, 0.1);
        }
        
        .card-title {
            display: flex;
            align-items: center;
            gap: 20px;
            font-size: 1.8rem;
            font-weight: 800;
            color: var(--dark);
        }
        
        .card-title i {
            color: white;
            background: var(--gradient);
            width: 50px;
            height: 50px;
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }
        
        /* Canvas Container */
        .canvas-container {
            position: relative;
            background: #f8f9fa;
            border-radius: var(--border-radius);
            overflow: hidden;
            margin-bottom: 30px;
            border: 2px solid rgba(155, 89, 182, 0.1);
            min-height: 400px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        #imageCanvas {
            max-width: 100%;
            max-height: 500px;
            display: none;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }
        
        .canvas-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
            background: linear-gradient(135deg, rgba(248, 249, 250, 0.9), rgba(240, 242, 255, 0.9));
            color: var(--gray);
            padding: 40px;
            text-align: center;
        }
        
        .upload-icon-large {
            font-size: 4rem;
            color: var(--primary);
            margin-bottom: 25px;
            opacity: 0.5;
        }
        
        /* Cropper Overlay */
        .crop-overlay {
            position: absolute;
            border: 2px dashed var(--primary);
            background: rgba(155, 89, 182, 0.1);
            cursor: move;
            display: none;
        }
        
        .crop-handle {
            position: absolute;
            width: 20px;
            height: 20px;
            background: var(--primary);
            border: 2px solid white;
            border-radius: 50%;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        }
        
        .handle-nw { top: -10px; left: -10px; cursor: nw-resize; }
        .handle-ne { top: -10px; right: -10px; cursor: ne-resize; }
        .handle-sw { bottom: -10px; left: -10px; cursor: sw-resize; }
        .handle-se { bottom: -10px; right: -10px; cursor: se-resize; }
        
        /* Toolbar */
        .toolbar {
            display: flex;
            gap: 15px;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }
        
        .tool-btn {
            padding: 15px 25px;
            background: white;
            border: 2px solid rgba(155, 89, 182, 0.2);
            border-radius: 15px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 12px;
            color: var(--dark);
        }
        
        .tool-btn:hover {
            border-color: var(--primary);
            background: rgba(155, 89, 182, 0.05);
            transform: translateY(-3px);
        }
        
        .tool-btn.active {
            background: var(--gradient);
            color: white;
            border-color: var(--primary);
            box-shadow: 0 6px 20px rgba(155, 89, 182, 0.3);
        }
        
        /* Preset Grid */
        .preset-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 15px;
            margin-bottom: 30px;
        }
        
        .preset-btn {
            padding: 15px;
            background: white;
            border: 2px solid rgba(155, 89, 182, 0.1);
            border-radius: 12px;
            cursor: pointer;
            text-align: center;
            transition: all 0.3s ease;
            font-weight: 600;
            color: var(--dark);
        }
        
        .preset-btn:hover {
            border-color: var(--primary);
            background: rgba(155, 89, 182, 0.05);
            transform: scale(1.05);
        }
        
        .preset-btn.active {
            background: var(--gradient);
            color: white;
            border-color: var(--primary);
        }
        
        /* Dimension Controls */
        .dimension-controls {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 25px;
            margin-bottom: 30px;
        }
        
        .dimension-group {
            background: rgba(155, 89, 182, 0.03);
            padding: 25px;
            border-radius: 15px;
            border: 2px solid rgba(155, 89, 182, 0.1);
        }
        
        .dimension-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
            color: var(--dark);
            font-weight: 700;
            font-size: 1.1rem;
        }
        
        .dimension-inputs {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            gap: 15px;
            align-items: center;
        }
        
        .dim-input {
            padding: 15px;
            border: 2px solid rgba(155, 89, 182, 0.2);
            border-radius: 12px;
            font-size: 1.1rem;
            font-weight: 600;
            text-align: center;
            color: var(--dark);
            background: white;
            transition: all 0.3s ease;
        }
        
        .dim-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
        }
        
        .dim-separator {
            font-size: 1.5rem;
            color: var(--primary);
            font-weight: 800;
        }
        
        /* Aspect Ratio */
        .aspect-ratio-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            margin-bottom: 30px;
        }
        
        .ratio-btn {
            padding: 15px 10px;
            background: white;
            border: 2px solid rgba(155, 89, 182, 0.1);
            border-radius: 12px;
            cursor: pointer;
            text-align: center;
            transition: all 0.3s ease;
            font-weight: 600;
            color: var(--dark);
        }
        
        .ratio-btn:hover {
            border-color: var(--primary);
            background: rgba(155, 89, 182, 0.05);
        }
        
        .ratio-btn.active {
            background: var(--gradient);
            color: white;
            border-color: var(--primary);
        }
        
        /* AI Features */
        .ai-features {
            background: linear-gradient(135deg, rgba(155, 89, 182, 0.05), rgba(52, 152, 219, 0.05));
            padding: 30px;
            border-radius: 20px;
            margin: 30px 0;
            border: 2px solid rgba(155, 89, 182, 0.1);
        }
        
        .ai-feature-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 25px;
        }
        
        .ai-feature-item {
            display: flex;
            align-items: center;
            gap: 15px;
            padding: 20px;
            background: white;
            border-radius: 15px;
            transition: all 0.3s ease;
        }
        
        .ai-feature-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        
        .ai-feature-icon {
            width: 50px;
            height: 50px;
            background: var(--gradient);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
            color: white;
        }
        
        /* Buttons */
        .premium-btn {
            background: var(--gradient);
            color: white;
            border: none;
            padding: 20px 35px;
            border-radius: var(--border-radius);
            font-size: 1.2rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            box-shadow: 0 8px 25px rgba(155, 89, 182, 0.3);
            position: relative;
            overflow: hidden;
        }
        
        .premium-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.6s;
        }
        
        .premium-btn:hover::before {
            left: 100%;
        }
        
        .premium-btn:hover:not(:disabled) {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(155, 89, 182, 0.4);
        }
        
        .premium-btn:active:not(:disabled) {
            transform: translateY(-2px);
        }
        
        .premium-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none !important;
        }
        
        .btn-success {
            background: linear-gradient(135deg, var(--success), #2ecc71);
        }
        
        .btn-warning {
            background: linear-gradient(135deg, var(--warning), #f1c40f);
        }
        
        .btn-danger {
            background: linear-gradient(135deg, var(--danger), #c0392b);
        }
        
        .btn-accent {
            background: var(--premium-gradient);
        }
        
        /* Stats Panel */
        .stats-panel {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
            margin: 30px 0;
        }
        
        .stat-item {
            background: linear-gradient(135deg, #f8f9ff, #f0f2ff);
            padding: 25px;
            border-radius: 15px;
            text-align: center;
            border: 2px solid rgba(155, 89, 182, 0.1);
            transition: all 0.3s ease;
        }
        
        .stat-item:hover {
            transform: translateY(-5px);
            border-color: var(--primary);
        }
        
        .stat-value-large {
            font-size: 2.5rem;
            font-weight: 900;
            color: var(--primary);
            margin-bottom: 10px;
        }
        
        .stat-label-large {
            font-size: 1rem;
            color: var(--gray);
            font-weight: 600;
        }
        
        /* Preview Section */
        .preview-section {
            display: none;
            margin-top: 30px;
        }
        
        .preview-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 25px;
            margin-bottom: 30px;
        }
        
        .preview-card {
            background: white;
            padding: 25px;
            border-radius: 20px;
            text-align: center;
            border: 2px solid rgba(155, 89, 182, 0.1);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        }
        
        .preview-title {
            font-weight: 700;
            margin-bottom: 20px;
            color: var(--dark);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-size: 1.2rem;
        }
        
        .preview-image {
            max-width: 100%;
            max-height: 250px;
            border-radius: 15px;
            margin-bottom: 20px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
            border: 1px solid rgba(155, 89, 182, 0.1);
        }
        
        /* Files List */
        .files-list {
            max-height: 350px;
            overflow-y: auto;
            margin-top: 25px;
        }
        
        .file-item {
            display: flex;
            align-items: center;
            gap: 20px;
            padding: 20px;
            background: white;
            border-radius: 15px;
            margin-bottom: 15px;
            border: 2px solid rgba(155, 89, 182, 0.1);
            transition: all 0.3s ease;
            cursor: pointer;
        }
        
        .file-item:hover {
            transform: translateX(10px);
            border-color: var(--primary);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        
        .file-item.selected {
            background: rgba(155, 89, 182, 0.05);
            border-color: var(--primary);
        }
        
        .file-icon {
            width: 60px;
            height: 60px;
            background: var(--gradient);
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            color: white;
        }
        
        .file-info {
            flex: 1;
        }
        
        .file-name {
            font-weight: 700;
            margin-bottom: 8px;
            color: var(--dark);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .file-details {
            display: flex;
            gap: 20px;
            font-size: 0.9rem;
            color: var(--gray);
        }
        
        /* Premium Features Section */
        .premium-section {
            background: linear-gradient(135deg, rgba(155, 89, 182, 0.1), rgba(52, 152, 219, 0.1));
            padding: 60px 40px;
            border-radius: var(--border-radius);
            margin: 60px 0;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        .premium-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 5px;
            background: var(--premium-gradient);
        }
        
        .premium-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 35px;
            margin-top: 50px;
        }
        
        .premium-feature-card {
            background: rgba(255, 255, 255, 0.95);
            padding: 40px 30px;
            border-radius: 25px;
            text-align: center;
            transition: all 0.4s ease;
            border: 2px solid rgba(155, 89, 182, 0.1);
            position: relative;
        }
        
        .premium-feature-card:hover {
            transform: translateY(-15px) scale(1.02);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
            border-color: var(--primary);
        }
        
        .premium-icon {
            width: 80px;
            height: 80px;
            background: var(--premium-gradient);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.2rem;
            color: white;
            margin: 0 auto 30px;
            box-shadow: 0 10px 30px rgba(243, 156, 18, 0.3);
        }
        
        /* Notification */
        .notification {
            position: fixed;
            bottom: 40px;
            right: 40px;
            padding: 25px 35px;
            background: var(--dark);
            color: white;
            border-radius: 20px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
            display: none;
            z-index: 1000;
            animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            max-width: 450px;
            border-left: 6px solid var(--primary);
        }
        
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateX(150px) scale(0.9);
            }
            to {
                opacity: 1;
                transform: translateX(0) scale(1);
            }
        }
        
        .notification.show {
            display: flex;
            align-items: center;
            gap: 20px;
        }
        
        /* Loader */
        .loader {
            display: inline-block;
            width: 28px;
            height: 28px;
            border: 4px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }
        
        /* Responsive Design */
        @media (max-width: 1200px) {
            .main-layout {
                grid-template-columns: 1fr;
                gap: 35px;
            }
            
            .dimension-controls {
                grid-template-columns: 1fr;
            }
            
            .preset-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            }
        }
        
        @media (max-width: 992px) {
            .glass-header {
                padding: 25px 30px;
            }
            
            .logo-text h1 {
                font-size: 2.3rem;
            }
            
            .header-stats {
                grid-template-columns: repeat(2, auto);
                gap: 20px;
            }
            
            .glass-card {
                padding: 30px 25px;
            }
            
            .preview-grid {
                grid-template-columns: 1fr;
            }
            
            .premium-grid {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            }
        }
        
        @media (max-width: 768px) {
            body {
                padding: 15px 10px;
            }
            
            .container {
                padding: 0 15px;
            }
            
            .glass-header {
                padding: 20px 25px;
                margin: 20px 0;
            }
            
            .header-content {
                flex-direction: column;
                text-align: center;
                gap: 30px;
            }
            
            .logo-section {
                flex-direction: column;
            }
            
            .header-stats {
                grid-template-columns: repeat(3, auto);
                justify-content: center;
            }
            
            .stat-badge {
                min-width: 100px;
                padding: 12px 15px;
            }
            
            .toolbar {
                justify-content: center;
            }
            
            .aspect-ratio-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .ai-feature-grid {
                grid-template-columns: 1fr;
            }
            
            .premium-btn {
                padding: 18px 25px;
                width: 100%;
                justify-content: center;
            }
            
            .notification {
                bottom: 20px;
                right: 20px;
                left: 20px;
                max-width: calc(100% - 40px);
            }
            
            .premium-section {
                padding: 40px 25px;
            }
            
            .premium-feature-card {
                padding: 30px 20px;
            }
        }
        
        @media (max-width: 576px) {
            .container {
                padding: 0 10px;
            }
            
            .logo-text h1 {
                font-size: 2rem;
            }
            
            .premium-tag {
                padding: 8px 20px;
                font-size: 0.9rem;
            }
            
            .header-stats {
                grid-template-columns: repeat(3, auto);
                gap: 15px;
            }
            
            .stat-badge {
                min-width: 85px;
                padding: 10px 12px;
            }
            
            .stat-value {
                font-size: 1.8rem;
            }
            
            .glass-card {
                padding: 25px 20px;
            }
            
            .card-title {
                font-size: 1.4rem;
            }
            
            .preset-grid {
                grid-template-columns: repeat(3, 1fr);
            }
            
            .dimension-inputs {
                grid-template-columns: 1fr;
            }
            
            .dim-separator {
                display: none;
            }
            
            .stat-value-large {
                font-size: 2rem;
            }
            
            .premium-feature-card {
                padding: 25px 15px;
            }
            
            .premium-icon {
                width: 60px;
                height: 60px;
                font-size: 1.8rem;
            }
        }
        
        /* Utility Classes */
        .text-center {
            text-align: center;
        }
        
        .mt-30 {
            margin-top: 30px;
        }
        
        .mb-30 {
            margin-bottom: 30px;
        }
        
        .hidden {
            display: none !important;
        }
        
        .flex-center {
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .space-between {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        /* Lock Icon for Premium */
        .premium-lock {
            position: absolute;
            top: 15px;
            right: 15px;
            color: var(--warning);
            font-size: 1.2rem;
        }