      :root {
            --primary: #4361ee;
            --primary-dark: #3a56d4;
            --secondary: #7209b7;
            --dark: #212529;
            --light: #f8f9fa;
            --gray: #6c757d;
            --success: #4cc9f0;
            --danger: #f72585;
            --warning: #f8961e;
            --sidebar-width: 280px;
            --header-height: 60px;
            --toolbar-height: 50px;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Roboto', sans-serif;
        }

        body {
            background-color: #1e1e2e;
            color: var(--light);
            overflow: hidden;
        }

        /* Header Styles */
        header {
            height: var(--header-height);
            background-color: var(--dark);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            border-bottom: 1px solid #333;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 700;
            font-size: 1.5rem;
            color: var(--light);
        }

        .logo i {
            color: var(--primary);
        }

        .header-actions {
            display: flex;
            gap: 15px;
        }

        .btn {
            padding: 8px 16px;
            border-radius: 4px;
            border: none;
            cursor: pointer;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.3s ease;
        }

        .btn-primary {
            background-color: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background-color: var(--primary-dark);
        }

        .btn-outline {
            background-color: transparent;
            border: 1px solid var(--gray);
            color: var(--light);
        }

        .btn-outline:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        /* Main Layout */
        .main-container {
            display: flex;
            height: calc(100vh - var(--header-height));
        }

        /* Sidebar Styles */
        .sidebar {
            width: var(--sidebar-width);
            background-color: var(--dark);
            border-right: 1px solid #333;
            overflow-y: auto;
            transition: all 0.3s ease;
        }

        .sidebar-section {
            padding: 15px;
            border-bottom: 1px solid #333;
        }

        .sidebar-title {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--gray);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .sidebar-items {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }

        .sidebar-item {
            background-color: #2d2d3d;
            border-radius: 6px;
            padding: 10px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .sidebar-item:hover {
            background-color: #3a3a4d;
        }

        .sidebar-item i {
            font-size: 1.2rem;
            margin-bottom: 5px;
            color: var(--primary);
                       text-decoration: none;
           color: #f7c376de;
        }

        .sidebar-item a {
           text-decoration: none;
           color: #ffffff;
        }

        #bg-remover {
                 text-decoration: none;
           color: #ffffff;
        }

        .sidebar-item[data-type="ellipse"] i {
            color: var(--success);
        }

        .sidebar-item[data-type="pen"] i {
            color: var(--warning);
        }

        .sidebar-item span {
            font-size: 0.8rem;
            display: block;
            text-decoration: none;
        }

        /* Toolbar Styles */
        .toolbar {
            height: var(--toolbar-height);
            background-color: #2d2d3d;
            border-bottom: 1px solid #333;
            display: flex;
            align-items: center;
            padding: 0 15px;
            gap: 15px;
        }

        .tool-group {
            display: flex;
            gap: 5px;
            padding-right: 15px;
            border-right: 1px solid #444;
        }

        .tool-btn {
            width: 36px;
            height: 36px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            background-color: transparent;
            border: none;
            color: var(--light);
            transition: all 0.2s ease;
        }

        .tool-btn:hover, .tool-btn.active {
            background-color: var(--primary);
        }

        /* Canvas Area */
        .canvas-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .canvas-container {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #2d2d3d;
            overflow: auto;
            padding: 20px;
            position: relative;
        }

        .canvas {
            width: 800px;
            height: 600px;
            /* background-color: white; */
            background-color: transparent;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            position: relative;
            overflow: hidden;
        }

        .canvas-element {
            position: absolute;
            cursor: move;
            border: 1px dashed transparent;
            user-select: none;
        }

        .canvas-element.selected {
            border-color: var(--primary);
        }

        .canvas-element.locked {
            cursor: not-allowed;
            opacity: 0.7;
        }

        .canvas-element.locked * {
            pointer-events: none;
        }

        .canvas-element img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            pointer-events: none;
        }

        .canvas-element .text-content {
            padding: 10px;
            font-family: 'Poppins', sans-serif;
            color: #333;
            user-select: none;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            outline: none;
            overflow: hidden;
            word-wrap: break-word;
        }

        .canvas-element .text-content.editable {
            cursor: text;
            user-select: text;
        }

        /* Text editing styles */
        .text-editing {
            box-shadow: 0 0 0 2px #4361ee;
            background-color: rgba(255, 255, 255, 0.1);
        }

        /* Ellipse specific styles */
        .canvas-element.ellipse {
            border-radius: 50%;
        }

        /* Transform Controls */
        .transform-controls {
            position: absolute;
            top: -30px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            background: var(--primary);
            border-radius: 4px;
            padding: 4px 8px;
            font-size: 0.8rem;
            color: white;
            white-space: nowrap;
            z-index: 100;
        }

        .transform-controls::after {
            content: '';
            position: absolute;
            bottom: -4px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
            border-top: 4px solid var(--primary);
        }

        .canvas-element.selected .transform-controls {
            display: block;
        }

        .resize-handle {
            position: absolute;
            width: 12px;
            height: 12px;
            background-color: var(--primary);
            border: 2px solid white;
            border-radius: 50%;
            z-index: 10;
            display: none;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .canvas-element.selected .resize-handle {
            display: block;
        }

        .resize-handle.top-left {
            top: -6px;
            left: -6px;
            cursor: nw-resize;
        }

        .resize-handle.top-right {
            top: -6px;
            right: -6px;
            cursor: ne-resize;
        }

        .resize-handle.bottom-left {
            bottom: -6px;
            left: -6px;
            cursor: sw-resize;
        }

        .resize-handle.bottom-right {
            bottom: -6px;
            right: -6px;
            cursor: se-resize;
        }

        .rotate-handle {
            position: absolute;
            top: -30px;
            left: 50%;
            transform: translateX(-50%);
            width: 20px;
            height: 20px;
            background-color: var(--primary);
            border: 2px solid white;
            border-radius: 50%;
            cursor: grab;
            display: none;
            z-index: 10;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .canvas-element.selected .rotate-handle {
            display: block;
        }

        .rotate-handle::before {
            content: '⟳';
            color: white;
            font-size: 10px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        .rotate-handle:active {
            cursor: grabbing;
        }

        /* Properties Panel */
        .properties-panel {
            width: 300px;
            background-color: var(--dark);
            border-left: 1px solid #333;
            overflow-y: auto;
            padding: 15px;
        }

        .panel-section {
            margin-bottom: 20px;
        }

        .panel-title {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--gray);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .property-group {
            margin-bottom: 15px;
        }

        .property-label {
            display: block;
            font-size: 0.8rem;
            margin-bottom: 5px;
            color: #aaa;
        }

        .property-input {
            width: 100%;
            padding: 8px;
            border-radius: 4px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            color: var(--light);
        }

        .color-picker {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .color-swatch {
            width: 30px;
            height: 30px;
            border-radius: 4px;
            background-color: var(--primary);
            cursor: pointer;
            border: 1px solid #555;
        }

        .slider-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .slider {
            flex: 1;
            height: 5px;
            background-color: #444;
            border-radius: 5px;
            outline: none;
            -webkit-appearance: none;
        }

        .slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 15px;
            height: 15px;
            border-radius: 50%;
            background: var(--primary);
            cursor: pointer;
        }

        /* Text Properties */
        .text-format-buttons {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 5px;
            margin-bottom: 10px;
        }

        .format-btn {
            padding: 6px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            border-radius: 4px;
            color: var(--light);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .format-btn.active {
            background-color: var(--primary);
        }

        .format-btn:hover {
            background-color: #3a3a4d;
        }

        /* Layer Panel */
        .layer-panel {
            margin-top: 20px;
        }

        .layer-item {
            display: flex;
            align-items: center;
            padding: 8px;
            background-color: #2d2d3d;
            margin-bottom: 5px;
            border-radius: 4px;
            cursor: pointer;
            position: relative;
            transition: all 0.2s ease;
            user-select: none;
        }

        .layer-item:hover {
            background-color: #3a3a4d;
        }

        .layer-item.selected {
            background-color: #3a3a4d;
            border-left: 3px solid var(--primary);
        }

        .layer-item.locked {
            opacity: 0.6;
        }

        .layer-item.dragging {
            opacity: 0.8;
            background-color: var(--primary);
            transform: scale(1.02);
            z-index: 1000;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }

        .layer-item.drag-over {
            border-top: 2px solid var(--primary);
        }

        .layer-icon {
            width: 30px;
            height: 30px;
            background-color: #555;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            flex-shrink: 0;
        }

        .layer-name {
            flex: 1;
            font-size: 0.9rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .layer-actions {
            display: flex;
            gap: 5px;
            flex-shrink: 0;
        }

        .layer-action {
            width: 24px;
            height: 24px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            background-color: transparent;
            border: none;
            color: var(--light);
            transition: all 0.2s ease;
        }

        .layer-action:hover {
            background-color: #444;
        }

        .layer-action.locked {
            color: var(--warning);
        }

        .layer-drag-handle {
            width: 16px;
            height: 16px;
            cursor: grab;
            color: #666;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 8px;
            flex-shrink: 0;
        }

        .layer-drag-handle:hover {
            color: var(--light);
        }

        .layer-drag-handle:active {
            cursor: grabbing;
        }

        .layer-order-buttons {
            display: flex;
            gap: 5px;
            margin-top: 10px;
        }

        .layer-order-btn {
            flex: 1;
            padding: 6px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            border-radius: 4px;
            color: var(--light);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            font-size: 0.8rem;
            transition: all 0.2s ease;
        }

        .layer-order-btn:hover {
            background-color: #3a3a4d;
        }

        .layer-order-btn:active {
            background-color: var(--primary);
        }

        /* Delete button */
        .delete-btn {
            position: absolute;
            top: -15px;
            right: -15px;
            width: 24px;
            height: 24px;
            background-color: var(--danger);
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 20;
            font-size: 12px;
            color: white;
            border: 2px solid white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .canvas-element.selected .delete-btn {
            background-color: var(--danger);
            display: flex;
        }

        /* Duplicate button */
        .duplicate-btn {
            position: absolute;
            top: -15px;
            left: -15px;
            width: 24px;
            height: 24px;
            background-color: var(--success);
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 20;
            font-size: 12px;
            color: white;
            border: 2px solid white;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        .canvas-element.selected .duplicate-btn {
            display: flex;
        }

        /* Responsive Design */
        @media (max-width: 1200px) {
            .sidebar {
                width: 240px;
            }
            
            .properties-panel {
                width: 250px;
            }
        }

        @media (max-width: 992px) {
            .sidebar {
                position: absolute;
                left: -280px;
                z-index: 100;
            }
            
            .sidebar.active {
                left: 0;
            }
            
            .properties-panel {
                position: absolute;
                right: -300px;
                z-index: 100;
            }
            
            .properties-panel.active {
                right: 0;
            }
            
            .toggle-sidebar, .toggle-properties {
                display: flex;
            }
        }

        .toggle-sidebar, .toggle-properties {
            display: none;
            position: absolute;
            top: 10px;
            width: 36px;
            height: 36px;
            border-radius: 4px;
            background-color: var(--dark);
            border: 1px solid #444;
            color: var(--light);
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 99;
        }

        .toggle-sidebar {
            left: 10px;
        }

        .toggle-properties {
            right: 10px;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background-color: var(--dark);
            border-radius: 8px;
            width: 90%;
            max-width: 600px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }

        .modal-title {
            font-size: 1.2rem;
            font-weight: 600;
        }

        .close-modal {
            background: none;
            border: none;
            color: var(--light);
            font-size: 1.5rem;
            cursor: pointer;
        }

        /* Background Remover Modal Styles */
        .bg-remover-preview {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }
        
        .image-preview-container {
            flex: 1;
            border: 1px solid #444;
            border-radius: 8px;
            overflow: hidden;
            position: relative;
        }
        
        .preview-title {
            text-align: center;
            padding: 8px;
            background-color: #2d2d3d;
            font-size: 0.9rem;
            color: #aaa;
            border-bottom: 1px solid #444;
        }
        
        .image-preview {
            width: 100%;
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #1e1e2e;
            position: relative;
        }
        
        .image-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        
        .preview-comparison {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #aaa;
            font-size: 0.9rem;
        }
        
        .preview-arrow {
            font-size: 1.5rem;
            margin: 10px 0;
            color: #4361ee;
        }
        
        .bg-remover-options {
            margin-bottom: 20px;
        }
        
        .option-group {
            margin-bottom: 15px;
        }
        
        .option-label {
            display: block;
            font-size: 0.9rem;
            margin-bottom: 8px;
            color: #aaa;
        }
        
        .option-select {
            width: 100%;
            padding: 8px;
            border-radius: 4px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            color: var(--light);
        }
        
        .option-checkbox {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .option-checkbox input {
            width: 16px;
            height: 16px;
        }
        
        .option-checkbox label {
            font-size: 0.9rem;
            color: #aaa;
        }
        
        .bg-remover-actions {
            display: flex;
            gap: 10px;
        }
        
        .bg-remover-actions .btn {
            flex: 1;
        }
        
        /* Loading overlay for background removal */
        .loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 10;
            border-radius: 8px;
        }
        
        .loading-text {
            margin-top: 15px;
            color: white;
            font-size: 0.9rem;
        }
        
        /* Enhanced transparency preview */
        .transparency-indicator {
            position: absolute;
            top: 5px;
            right: 5px;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 3px 6px;
            border-radius: 3px;
            font-size: 0.7rem;
            display: none;
        }
        
        .canvas-element.transparent .transparency-indicator {
            display: block;
        }

        /* Loading Spinner */
        .spinner {
            display: none;
            width: 40px;
            height: 40px;
            border: 4px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top-color: var(--primary);
            animation: spin 1s ease-in-out infinite;
            margin: 20px auto;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Export Options */
        .export-options {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-bottom: 15px;
        }

        .export-option {
            background-color: #2d2d3d;
            padding: 15px;
            border-radius: 6px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px solid transparent;
        }

        .export-option:hover {
            background-color: #3a3a4d;
        }

        .export-option.active {
            background-color: var(--primary);
            border-color: var(--primary);
        }

        .export-option i {
            font-size: 2rem;
            margin-bottom: 10px;
            color: var(--primary);
        }

        .export-option.active i {
            color: white;
        }

        .export-option span {
            display: block;
            font-size: 0.9rem;
        }

        /* Notification */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            background: var(--primary);
            color: white;
            padding: 10px 20px;
            border-radius: 4px;
            z-index: 10000;
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            transition: opacity 0.5s ease;
        }

        /* Image Enhancement Styles */
        #image-enhancement-properties {
            display: none;
        }

        .image-enhancement-preview {
            width: 100%;
            height: 80px;
            background-color: #2d2d3d;
            border-radius: 6px;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #444;
            overflow: hidden;
        }

        .image-enhancement-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        .filter-intensity {
            margin-top: 10px;
        }

        .filter-intensity label {
            font-size: 0.8rem;
            color: #aaa;
            margin-bottom: 5px;
            display: block;
        }

        /* New styles for enhanced features */
        .shape-options {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .shape-option {
            background-color: #2d2d3d;
            padding: 10px;
            border-radius: 6px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px solid transparent;
        }
        
        .shape-option:hover {
            background-color: #3a3a4d;
        }
        
        .shape-option.active {
            background-color: var(--primary);
            border-color: var(--primary);
        }
        
        .shape-option i {
            font-size: 1.5rem;
            margin-bottom: 5px;
            color: var(--primary);
        }
        
        .shape-option.active i {
            color: white;
        }
        
        .shape-option span {
            display: block;
            font-size: 0.8rem;
        }
        
        .gradient-preview {
            width: 100%;
            height: 40px;
            border-radius: 4px;
            margin-bottom: 10px;
            border: 1px solid #444;
        }
        
        .gradient-controls {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .gradient-color-inputs {
            display: flex;
            gap: 10px;
        }
        
        .gradient-color-input {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .gradient-type-select {
            width: 100%;
            padding: 8px;
            border-radius: 4px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            color: var(--light);
        }
        
        .gradient-angle-container {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .color-presets {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 5px;
            margin-top: 10px;
        }
        
        .color-preset {
            width: 25px;
            height: 25px;
            border-radius: 4px;
            cursor: pointer;
            border: 2px solid transparent;
        }
        
        .color-preset:hover {
            transform: scale(1.1);
        }
        
        .color-preset.active {
            border-color: white;
            box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
        }
        
        .text-shadow-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .text-shadow-input {
            flex: 1;
        }
        
        .text-stroke-controls {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .text-stroke-input {
            flex: 1;
        }
        
        .text-effects {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 5px;
            margin-bottom: 10px;
        }
        
        .text-effect-btn {
            padding: 6px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            border-radius: 4px;
            color: var(--light);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
        }
        
        .text-effect-btn.active {
            background-color: var(--primary);
        }
        
        .text-effect-btn:hover {
            background-color: #3a3a4d;
        }

        /* Template Modal Styles */
        .template-modal-content {
            max-width: 800px;
            width: 95%;
        }
        
        .template-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .template-item {
            background-color: #2d2d3d;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }
        
        .template-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        }
        
        .template-item.active {
            border-color: #4361ee;
        }
        
        .template-preview {
            height: 120px;
            background-color: #3a3a4d;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }
        
        .template-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        
        .template-info {
            padding: 10px;
            text-align: center;
        }
        
        .template-name {
            font-weight: 500;
            margin-bottom: 5px;
        }
        
        .template-dimensions {
            font-size: 0.8rem;
            color: #aaa;
        }
        
        .custom-size-inputs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-top: 15px;
        }
        
        .custom-size-input {
            display: flex;
            flex-direction: column;
        }
        
        .custom-size-input label {
            font-size: 0.9rem;
            margin-bottom: 5px;
            color: #aaa;
        }
        
        .custom-size-input input {
            padding: 8px;
            border-radius: 4px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            color: var(--light);
        }
        
        .template-actions {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }
        
        .template-actions .btn {
            flex: 1;
        }

        /* Template Categories */
        .template-category {
            margin-bottom: 20px;
        }
        
        .category-title {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: var(--light);
            border-bottom: 1px solid #444;
            padding-bottom: 5px;
        }
        
        .size-preset-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .size-preset {
            background-color: #2d2d3d;
            padding: 10px;
            border-radius: 6px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px solid transparent;
        }
        
        .size-preset:hover {
            background-color: #3a3a4d;
        }
        
        .size-preset.active {
            background-color: var(--primary);
            border-color: var(--primary);
        }
        
        .size-preset-name {
            font-weight: 500;
            margin-bottom: 5px;
        }
        
        .size-preset-dimensions {
            font-size: 0.8rem;
            color: #aaa;
        }
        
        .template-preview-container {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .template-preview-item {
            flex: 1;
            min-width: 200px;
            background-color: #2d2d3d;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }
        
        .template-preview-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        }
        
        .template-preview-item.active {
            border-color: #4361ee;
        }
        
        .template-preview-visual {
            height: 120px;
            background-color: #3a3a4d;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }
        
        .template-preview-info {
            padding: 10px;
        }
        
        .template-preview-name {
            font-weight: 500;
            margin-bottom: 5px;
        }
        
        .template-preview-dimensions {
            font-size: 0.8rem;
            color: #aaa;
        }

        /* YouTube Export Styles */
        .youtube-export-options {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .youtube-export-preview {
            width: 100%;
            height: 180px;
            background-color: #2d2d3d;
            border-radius: 8px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 15px;
            border: 2px solid #444;
        }
        
        .youtube-export-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        
        .youtube-export-info {
            background-color: #2d2d3d;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 15px;
        }
        
        .youtube-export-info h4 {
            margin-bottom: 10px;
            color: var(--primary);
        }
        
        .youtube-export-info p {
            font-size: 0.9rem;
            color: #aaa;
            margin-bottom: 8px;
        }
        
        .youtube-export-actions {
            display: flex;
            gap: 10px;
        }
        
        .youtube-export-actions .btn {
            flex: 1;
        }

        /* Custom Template Modal Styles */
        .custom-template-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        
        .custom-template-modal.active {
            display: flex;
        }
        
        .custom-template-content {
            background-color: var(--dark);
            border-radius: 8px;
            width: 90%;
            max-width: 800px;
            padding: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .custom-template-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .custom-template-title {
            font-size: 1.2rem;
            font-weight: 600;
        }
        
        .custom-template-close {
            background: none;
            border: none;
            color: var(--light);
            font-size: 1.5rem;
            cursor: pointer;
        }
        
        .custom-template-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .custom-template-item {
            background-color: #2d2d3d;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }
        
        .custom-template-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
        }
        
        .custom-template-item.active {
            border-color: #4361ee;
        }
        
        .custom-template-preview {
            height: 120px;
            background-color: #3a3a4d;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }
        
        .custom-template-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }
        
        .custom-template-info {
            padding: 10px;
            text-align: center;
        }
        
        .custom-template-name {
            font-weight: 500;
            margin-bottom: 5px;
        }
        
        .custom-template-dimensions {
            font-size: 0.8rem;
            color: #aaa;
        }
        
        .custom-template-options {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid #444;
        }
        
        .custom-template-option-group {
            margin-bottom: 15px;
        }
        
        .custom-template-option-label {
            display: block;
            font-size: 0.9rem;
            margin-bottom: 8px;
            color: #aaa;
        }
        
        .custom-template-inputs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }
        
        .custom-template-input {
            display: flex;
            flex-direction: column;
        }
        
        .custom-template-input label {
            font-size: 0.9rem;
            margin-bottom: 5px;
            color: #aaa;
        }
        
        .custom-template-input input {
            padding: 8px;
            border-radius: 4px;
            background-color: #2d2d3d;
            border: 1px solid #444;
            color: var(--light);
        }
        
        .custom-template-actions {
            display: flex;
            gap: 10px;
            margin-top: 20px;
        }
        
        .custom-template-actions .btn {
            flex: 1;
        }

        .vid {
            text-decoration: none;
            color: #ffffff;
        }
                .vid a {
            text-decoration: none;
                   }