/* ============================================
   PHOTO EDITOR - COMPACT & ENHANCED
   ============================================ */

/* === GRADIENT TEXT === */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === FEATURE BADGES === */
.feature-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.3s ease;
}
body.dark .feature-badge {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}
.feature-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* === LOADING OVERLAY === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.loading-overlay.ct-hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === EDITOR WRAPPER === */
#editor-wrapper {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}
body.dark #editor-wrapper {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

/* === EDITOR TOOLBAR === */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}
body.dark .editor-toolbar {
    background: var(--bg-dark);
    border-bottom-color: var(--border-dark);
}

.toolbar-section {
    display: flex;
    gap: 0.5rem;
    padding-right: 0.5rem;
    border-right: 1px solid var(--border-light);
}
body.dark .toolbar-section {
    border-right-color: var(--border-dark);
}
.toolbar-section:last-child {
    border-right: none;
}

.toolbar-btn {
    padding: 0.6rem 0.8rem;
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}
body.dark .toolbar-btn {
    background: var(--card-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}
.toolbar-btn:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
body.dark .toolbar-btn:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}
.toolbar-btn:active,
.toolbar-btn.active {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    transform: translateY(0);
}
.toolbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.zoom-level-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    min-width: 3rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.dark .zoom-level-text {
    color: var(--text-dark);
}

/* === CANVAS WRAPPER === */
.canvas-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    max-height: calc(100vh - 400px);
    background: var(--bg-light);
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    padding: 2rem;
    overflow: auto;
}
body.dark .canvas-wrapper {
    background: var(--bg-dark);
    background-image: 
        linear-gradient(45deg, #1a1a2e 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a2e 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a2e 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a2e 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

#photo-canvas {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
}

/* === COMPACT SETTINGS PANEL === */
.settings-panel {
    max-height: auto;
    overflow-y: visible;
    background: var(--card-light);
    border-top: 1px solid var(--border-light);
    padding: 0.75rem 1rem;
}
body.dark .settings-panel {
    background: var(--card-dark);
    border-top-color: var(--border-dark);
}

.settings-content {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.settings-inline label {
    min-width: 60px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-light);
}
body.dark .settings-inline label {
    color: var(--text-dark);
}

.settings-input-compact {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}
body.dark .settings-input-compact {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}

.settings-slider-compact {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none; /* For compatibility */
}
body.dark .settings-slider-compact {
    background: var(--border-dark);
}
.settings-slider-compact::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--brand-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}
.settings-slider-compact::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.settings-slider-compact::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--brand-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.value-display {
    min-width: 35px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--brand-primary);
}

.settings-color-compact {
    width: 40px;
    height: 32px;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    cursor: pointer;
}
body.dark .settings-color-compact {
    border-color: var(--border-dark);
}

/* === COMPACT BUTTONS === */
.btn-compact {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}
body.dark .btn-compact {
    border-color: var(--border-dark);
}
.btn-compact:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}
.btn-primary:hover {
    background: var(--brand-secondary);
    border-color: var(--brand-secondary);
}

.btn-secondary {
    background: var(--card-light);
    color: var(--text-light);
}
body.dark .btn-secondary {
    background: var(--card-dark);
    color: var(--text-dark);
}
.btn-secondary:hover {
    background: var(--brand-primary);
    color: white;
}
body.dark .btn-secondary:hover {
    background: var(--brand-primary);
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}
.btn-danger:hover {
    background: #dc2626;
}

/* === COMPACT SHAPE BUTTONS === */
.shape-buttons-compact {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.shape-btn-compact {
    padding: 0.6rem;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    flex: 1;
    min-width: 45px;
}
body.dark .shape-btn-compact {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}
.shape-btn-compact:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: white;
    transform: scale(1.05);
}
body.dark .shape-btn-compact:hover {
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* === COMPACT STICKER GRID === */
.sticker-grid-compact {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.sticker-btn-compact {
    padding: 0.5rem;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
}
body.dark .sticker-btn-compact {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}
.sticker-btn-compact:hover {
    border-color: var(--brand-primary);
    transform: scale(1.1);
}
body.dark .sticker-btn-compact:hover {
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* === COMPACT FILTER BUTTONS === */
.filter-buttons-compact {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn-compact {
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.8rem;
    flex: 1;
    min-width: 70px;
    text-align: center;
}
body.dark .filter-btn-compact {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}
.filter-btn-compact:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: white;
}
body.dark .filter-btn-compact:hover {
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* === COMPACT CROP RATIOS === */
.crop-controls-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

.crop-divider {
    width: 2px;
    height: 24px;
    background: var(--border-light);
    margin: 0 0.25rem;
}
body.dark .crop-divider {
    background: var(--border-dark);
}

.ratio-btn-compact {
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border: 2px solid var(--border-light);
    border-radius: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
}
body.dark .ratio-btn-compact {
    background: var(--bg-dark);
    border-color: var(--border-dark);
    color: var(--text-dark);
}
.ratio-btn-compact:hover,
.ratio-btn-compact.active {
    border-color: var(--brand-primary);
    background: var(--brand-primary);
    color: white;
}
body.dark .ratio-btn-compact:hover,
body.dark .ratio-btn-compact.active {
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* === EDITOR FOOTER BAR === */
.editor-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}
body.dark .editor-footer-bar {
    background: var(--bg-dark);
    border-top-color: var(--border-dark);
}

/* === FEATURES SECTION === */
.features-section {
    padding: 4rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}
body.dark .feature-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.15);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

/* === FAQ SECTION === */
.faq-section {
    padding: 4rem 0;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}
body.dark .faq-item {
    background: var(--card-dark);
    border-color: var(--border-dark);
}
.faq-item:hover {
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.1);
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}
body.dark .faq-question {
    color: var(--text-dark);
}

.faq-answer {
    color: var(--text-light);
    opacity: 0.8;
    line-height: 1.6;
}
body.dark .faq-answer {
    color: var(--text-dark);
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    #editor-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        z-index: 100;
        display: flex;
        flex-direction: column;
    }
    
    .editor-toolbar {
        padding: 0.5rem;
        gap: 0.25rem;
        flex-shrink: 0;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .toolbar-section {
        padding-right: 0.25rem;
        gap: 0.25rem;
    }
    
    .toolbar-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.9rem;
    }
    
    .canvas-wrapper {
        flex: 1;
        min-height: 0;
        max-height: none;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #photo-canvas {
        max-width: 100%;
        max-height: 100%;
        width: auto !important;
        height: auto !important;
    }
    
    .settings-panel {
        flex-shrink: 0;
        max-height: none;
        padding: 0.5rem 0.75rem;
        overflow-y: visible;
    }
    
    .editor-footer-bar {
        padding: 0.5rem;
        flex-shrink: 0;
        gap: 0.5rem;
    }
    
    .editor-footer-bar .btn-primary, 
    .editor-footer-bar .btn-secondary {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .editor-footer-bar .hidden {
        display: none;
    }
    
    .editor-footer-bar i {
        font-size: 0.9rem;
    }
    
    .gradient-text {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .crop-controls-inline {
        flex-wrap: wrap;
    }
    
    .settings-inline {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .feature-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .toolbar-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .settings-inline label {
        min-width: 50px;
        font-size: 0.8rem;
    }
    
    .filter-btn-compact {
        font-size: 0.75rem;
        min-width: 60px;
    }
}
