/**
 * Premium Digital Studio Styles
 * Modern, performant, and maintainable CSS architecture
 */

/* ============================================
   1. CSS Custom Properties & Theme System
   ============================================ */

:root {
    /* Premium Color Palette */
    --premium-primary: var(--primary-color);
    --premium-primary-dark: var(--primary-dark);
    --premium-primary-light: var(--primary-light);
    --premium-secondary: var(--secondary-color);
    --premium-accent: var(--accent-color);
    --premium-success: #10b981;
    --premium-warning: #f59e0b;
    --premium-error: #ef4444;
    --premium-info: var(--primary-color);

    /* Gradient Definitions */
    --gradient-primary: linear-gradient(135deg, var(--premium-primary) 0%, var(--premium-secondary) 100%);
    --gradient-premium: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Premium Shadows */
    --shadow-premium-sm: 0 2px 4px rgba(var(--primary-color-rgb), 0.1);
    --shadow-premium-md: 0 4px 6px -1px rgba(var(--primary-color-rgb), 0.1), 0 2px 4px -1px rgba(var(--primary-color-rgb), 0.06);
    --shadow-premium-lg: 0 10px 15px -3px rgba(var(--primary-color-rgb), 0.1), 0 4px 6px -2px rgba(var(--primary-color-rgb), 0.05);
    --shadow-premium-xl: 0 20px 25px -5px rgba(var(--primary-color-rgb), 0.1), 0 10px 10px -5px rgba(var(--primary-color-rgb), 0.04);

    /* Animation Timings */
    --animation-fast: 150ms;
    --animation-base: 250ms;
    --animation-slow: 350ms;
    --animation-slower: 500ms;

    /* Easing Functions */
    --ease-in-out-expo: cubic-bezier(0.87, 0, 0.13, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Dark Mode Premium Colors */
.dark-mode {
    --premium-primary: var(--primary-color);
    --premium-primary-dark: var(--primary-dark);
    --premium-primary-light: var(--primary-light);
    --gradient-premium: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* ============================================
   2. Premium Typography
   ============================================ */

@font-face {
    font-family: 'Premium Sans';
    src: local('Inter'), local('SF Pro Display'), local('Segoe UI');
    font-display: swap;
}

.premium-heading {
    font-family: 'Premium Sans', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   3. Premium Components
   ============================================ */

/* Glass Morphism Card */
.premium-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    transition: all var(--animation-base) var(--ease-out-expo);
}

.premium-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium-lg);
    border-color: rgba(var(--primary-color-rgb), 0.2);
}

/* Premium Button */
.btn-premium {
    position: relative;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    color: var(--ds-accent-ink);
    background: var(--gradient-premium);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--animation-base) var(--ease-out-expo);
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform var(--animation-slow) var(--ease-out-expo);
}

.btn-premium:hover::before {
    transform: translateX(100%);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium-lg);
}

.btn-premium:active {
    transform: translateY(0);
}

/* Premium Input */
.input-premium {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
    border-radius: 8px;
    transition: all var(--animation-base) var(--ease-out-expo);
}

.input-premium:focus {
    outline: none;
    border-color: var(--premium-primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
    background: rgba(255, 255, 255, 0.1);
}

.input-premium::placeholder {
    color: rgba(var(--ds-accent-rgb), 0.7);
}

/* Premium Badge */
.badge-premium {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ds-accent-ink);
    background: var(--gradient-premium);
    border-radius: 20px;
    box-shadow: var(--shadow-premium-sm);
}

/* ============================================
   4. Premium Animations
   ============================================ */

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(var(--primary-color-rgb), 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(var(--primary-color-rgb), 0.8);
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes slide-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation Classes */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

.animate-slide-up {
    animation: slide-in-up var(--animation-base) var(--ease-out-expo);
}

.animate-slide-down {
    animation: slide-in-down var(--animation-base) var(--ease-out-expo);
}

.animate-fade-in {
    animation: fade-in var(--animation-slow) var(--ease-out-expo);
}

.animate-scale-in {
    animation: scale-in var(--animation-base) var(--ease-out-expo);
}

/* ============================================
   5. Premium Loading States
   ============================================ */

.skeleton-loader {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg,
            rgba(var(--primary-color-rgb), 0.05) 25%,
            rgba(var(--primary-color-rgb), 0.1) 50%,
            rgba(var(--primary-color-rgb), 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.spinner-premium {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--primary-color-rgb), 0.1);
    border-top-color: var(--premium-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   6. Premium Tooltips
   ============================================ */

.tooltip-premium {
    position: relative;
}

.tooltip-premium::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ds-on-media);
    background: var(--gradient-dark);
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--animation-base) var(--ease-out-expo);
}

.tooltip-premium::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    border: 5px solid transparent;
    border-top-color: var(--ds-accent);
    opacity: 0;
    pointer-events: none;
    transition: all var(--animation-base) var(--ease-out-expo);
}

.tooltip-premium:hover::before,
.tooltip-premium:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

/* ============================================
   7. Premium Modal
   ============================================ */

.modal-premium {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--animation-base) var(--ease-out-expo);
}

.modal-premium.active {
    opacity: 1;
    pointer-events: all;
}

.modal-premium-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    padding: 32px;
    background: var(--bg-elevated);
    border-radius: 16px;
    box-shadow: var(--shadow-premium-xl);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--animation-base) var(--ease-out-expo);
    overflow-y: auto;
}

.modal-premium.active .modal-premium-content {
    transform: scale(1) translateY(0);
}

/* ============================================
   8. Premium Notification Toast
   ============================================ */

.toast-premium {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-on-media);
    background: var(--gradient-dark);
    border-radius: 8px;
    box-shadow: var(--shadow-premium-lg);
    transform: translateX(400px);
    transition: transform var(--animation-base) var(--ease-out-expo);
    z-index: 9999;
}

.toast-premium.show {
    transform: translateX(0);
}

.toast-premium.success {
    background: linear-gradient(135deg, var(--ds-ok) 0%, var(--ds-ok) 100%);
}

.toast-premium.error {
    background: linear-gradient(135deg, var(--ds-danger) 0%, var(--ds-danger) 100%);
}

.toast-premium.warning {
    background: linear-gradient(135deg, var(--ds-warn) 0%, var(--ds-warn) 100%);
}

/* ============================================
   9. Premium Progress Bars
   ============================================ */

.progress-premium {
    width: 100%;
    height: 6px;
    background: rgba(var(--primary-color-rgb), 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-premium-bar {
    height: 100%;
    background: var(--gradient-premium);
    border-radius: 3px;
    transition: width var(--animation-slow) var(--ease-out-expo);
}

.progress-premium-indeterminate .progress-premium-bar {
    width: 30%;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(400%);
    }
}

/* ============================================
   10. Premium Image Effects
   ============================================ */

.image-premium {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.image-premium img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--animation-slow) var(--ease-out-expo);
}

.image-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity var(--animation-base) var(--ease-out-expo);
    pointer-events: none;
}

.image-premium:hover img {
    transform: scale(1.05);
}

.image-premium:hover::before {
    opacity: 1;
}

/* ============================================
   11. Responsive Utilities
   ============================================ */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }

    .show-desktop {
        display: block !important;
    }
}

/* ============================================
   12. Accessibility Enhancements
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid var(--premium-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   13. Multi-Angle Edit Modal
   ============================================ */

.multi-angle-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.multi-angle-modal[style*="display: block"],
.multi-angle-modal[style*="display: flex"] {
    opacity: 1;
    pointer-events: auto;
}

.multi-angle-content {
    background: rgba(var(--ds-accent-rgb), 0.85);
    /* Darker glass for better contrast */
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 400px;
    max-width: 90%;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.multi-angle-modal[style*="display: block"] .multi-angle-content,
.multi-angle-modal[style*="display: flex"] .multi-angle-content {
    transform: scale(1);
}

.multi-angle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
}

.multi-angle-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to right, var(--ds-surface), var(--ds-line-strong));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.multi-angle-header .header-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.multi-angle-header .header-close:hover {
    color: var(--ds-on-media);
}

.control-group {
    margin-bottom: 24px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.control-header label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.value-badge {
    background: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    border: 1px solid rgba(var(--primary-color-rgb), 0.3);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Slider Headers */
.slider-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.slider-control-header label {
    font-size: 0.9rem;
    color: rgba(var(--ds-ink-rgb), 0.9);
    font-weight: 500;
}

.range-label {
    font-size: 0.8rem;
    color: rgba(var(--ds-ink-rgb), 0.6);
    min-width: 20px;
    text-align: center;
}

/* Vertical Divider */
.vertical-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
    flex-shrink: 0;
}

.vertical-divider.hidden {
    display: none;
}

/* Updated Slider Styles to match Studio Mode (Orange) */
.premium-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    /* Thinner track like studio mode */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    flex: 1;
    cursor: pointer;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--ds-accent);
    /* Orange thumb */
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(var(--ds-accent-rgb), 0.4);
    transition: transform 0.1s;
    margin-top: -6px;
    /* Center on 4px track */
}

/* Chrome/Safari specific track */
.premium-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: transparent;
    /* Handled by JS gradient or default background */
    border-radius: 2px;
}

/* Firefox thumb */
.premium-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--ds-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(var(--ds-accent-rgb), 0.4);
}

.premium-slider:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 14px rgba(var(--ds-accent-rgb), 0.6);
}

.slider-helper-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 12px;
    padding: 8px 0;
}

.premium-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
}

.premium-checkbox:hover {
    color: var(--ds-on-media);
}

.premium-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.premium-checkbox .checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 24px;
    background-color: transparent;
    border-radius: 50%;
    /* Circular */
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-checkbox:hover .checkmark {
    border-color: rgba(255, 255, 255, 0.6);
}

.premium-checkbox input:checked~.checkmark {
    background-color: var(--ds-accent);
    /* Orange active */
    border-color: var(--ds-accent);
    box-shadow: 0 0 10px rgba(var(--ds-accent-rgb), 0.3);
}

.premium-checkbox .checkmark:after {
    content: "";
    display: none;
    width: 6px;
    height: 10px;
    border: solid var(--ds-accent-ink);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
    /* Slight optical adjustment */
}

.premium-checkbox input:checked~.checkmark:after {
    display: block;
}

.btn-icon.small {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-icon.small:hover {
    color: var(--ds-on-media);
    background: rgba(255, 255, 255, 0.1);
}

.multi-angle-actions {
    margin-top: 24px;
}

/* ============================================
   14. Edit Action Bar (Refactored)
   ============================================ */

.edit-mode-input {
    display: none;
    /* Hidden by default, shown only in edit mode */
    align-items: center;
    gap: 16px;
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 90%;
    z-index: 999;
    margin: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Show edit bar in edit mode AND creative mode */
body[data-app-mode="creative"] .edit-mode-input:not(.hidden) {
    display: flex;
}

/* Perspective Icon Container */
.edit-perspective-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.standalone-perspective {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(var(--ds-ink-rgb), 0.06);
    /* Neutral transparent dark */
    border: 1px solid rgba(var(--ds-ink-rgb), 0.08);
    color: rgba(var(--ds-ink-rgb), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.standalone-perspective:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ds-on-media);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Main Action Bar */
.edit-action-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(var(--ds-ink-rgb), 0.06);
    /* Neutral transparent dark matching nav */
    /* Dark background matching gallery */
    border: 1px solid rgba(var(--ds-ink-rgb), 0.08);
    border-radius: 28px;
    /* Fully rounded pill */
    padding: 6px 8px 6px 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    gap: 6px;
    height: 56px;
}

/* Selected Image Thumb */
.edit-selected-thumb {
    width: 60px;
    /* Wider width for pill shape */
    height: 36px;
    border-radius: 100px;
    /* Pill shape */
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
    flex-shrink: 0;
}

/* Slider Value Badge (Matches "1" badge style) */
.value-badge {
    background-color: var(--ds-accent);
    color: var(--ds-accent-ink);
    /* White text */
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    min-width: 30px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(var(--ds-accent-rgb), 0.3);
}

.edit-selected-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-selected-thumb i {
    font-size: 14px;
    color: rgba(var(--ds-ink-rgb), 0.55);
}

.edit-selected-thumb.has-image {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Action Buttons */
.edit-bar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(var(--ds-ink-rgb), 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    flex-shrink: 0;
}

.edit-bar-btn:hover {
    background: rgba(var(--ds-ink-rgb), 0.1);
    color: var(--ds-ink);
}

.edit-bar-btn.active {
    background: rgba(var(--primary-color-rgb), 0.15);
    /* Primary tint */
    color: var(--primary-light);
    /* Primary light */
}

.edit-bar-btn.hidden {
    display: none !important;
}

/* Smart Edit Specific */
#smartEditToggle.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ds-ink);
}

/* Dividers */
.vertical-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 6px;
}

.vertical-divider.transparent {
    background: transparent;
    width: 2px;
}

.vertical-divider.hidden {
    display: none;
}

/* Input Area */
.edit-input-wrapper-inner {
    flex: 1;
    margin: 0 12px;
    min-width: 150px;
}

.edit-bar-input {
    width: 100%;
    background: transparent;
    border: none;
    color: rgba(var(--ds-ink-rgb), 0.95);
    font-size: 15px;
    padding: 8px 0;
    outline: none;
    font-weight: 500;
}

.edit-bar-input::placeholder {
    color: rgba(var(--ds-ink-rgb), 0.35);
    font-weight: 400;
}

/* Send Button */
.edit-send-btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ds-accent);
    /* Orange accent */
    border: none;
    color: var(--ds-accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(var(--ds-accent-rgb), 0.3);
    flex-shrink: 0;
}

.edit-send-btn-circle:hover {
    transform: scale(1.05);
    background: var(--ds-accent);
    box-shadow: 0 6px 16px rgba(var(--ds-accent-rgb), 0.4);
}

.edit-send-btn-circle:active {
    transform: scale(0.95);
}

.edit-send-btn-circle:disabled {
    background: var(--ds-line-strong);
    cursor: not-allowed;
    box-shadow: none;
    color: rgba(var(--ds-ink-rgb), 0.5);
}

/* Model Selector Button Override */
/* Model Selector Button Override */
.edit-model-selector button.edit-model-btn {
    height: 42px;
    background: rgba(var(--ds-ink-rgb), 0.05);
    border: none;
    border-radius: 21px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ds-ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.edit-model-selector button.edit-model-btn:hover {
    background: rgba(var(--ds-ink-rgb), 0.1);
}

.edit-model-selector button.edit-model-btn i {
    color: var(--ds-accent);
    /* Orange icon */
}

/* ============================================
   15. Fullscreen Inline Edit Enhancements
   ============================================ */

/* Fullscreen inline edit - sits inside .fullscreen-actions, no separate background */
/* Note: display is controlled by JavaScript (none/flex), DO NOT use !important here */
.fullscreen-inline-edit {
    /* display: flex is set by JS when shown */
    align-items: center;
    gap: 8px;
    /* Transparent - inherits from parent .fullscreen-actions */
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0;
    padding: 0;
    border: none !important;
    box-shadow: none !important;
}

/* FS Edit Perspective Button (standalone, matches action bar btn-icon size) */
.fs-edit-perspective-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--ds-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    flex-shrink: 0;
}

.fs-edit-perspective-btn:hover {
    background: rgba(var(--ds-ink-rgb), 0.1);
    color: var(--ds-ink);
}

/* FS Edit Model Selector */
.fs-edit-model-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.fs-edit-model-btn {
    height: 32px;
    background: rgba(var(--ds-ink-rgb), 0.06);
    border: none;
    border-radius: 16px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ds-ink);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.fs-edit-model-btn:hover {
    background: rgba(var(--ds-ink-rgb), 0.1);
}

.fs-edit-model-btn i:first-child {
    color: var(--ds-accent);
}

.fs-edit-model-btn i:last-child {
    font-size: 10px;
    opacity: 0.6;
}

.fs-edit-model-name {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-edit-model-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: rgba(var(--ds-media-glass-rgb), 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10000;
}

.fs-edit-model-selector.open .fs-edit-model-dropdown {
    display: block;
}

.fs-edit-model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.15s;
}

.fs-edit-model-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fs-edit-model-option.active {
    background: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-light);
}

.fs-edit-model-option .model-capability-icons {
    display: flex;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.fs-edit-model-option .model-capability-icons i {
    opacity: 0.7;
}

/* FS Edit Divider - matches fullscreen-divider */
.fs-edit-divider {
    width: 1px;
    height: 20px;
    background: rgba(var(--ds-ink-rgb), 0.15);
    margin: 0 6px;
}

/* FS Edit Tool Buttons */
.fs-edit-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(var(--ds-ink-rgb), 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    flex-shrink: 0;
}

.fs-edit-tool-btn:hover {
    background: rgba(var(--ds-ink-rgb), 0.1);
    color: var(--ds-ink);
}

.fs-edit-tool-btn.active {
    background: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-light);
}

.fs-edit-tool-btn.hidden {
    display: none !important;
}

/* Smart Edit specific */
#fsSmartEditToggle.active {
    background: rgba(var(--ds-accent-rgb), 0.15);
    color: var(--ds-accent);
}

/* Fullscreen inline input */
.fullscreen-inline-input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    background: transparent;
    border: none;
    color: var(--ds-ink);
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
}

.fullscreen-inline-input::placeholder {
    color: rgba(var(--ds-ink-rgb), 0.4);
}

/* Send and Cancel buttons */
.fullscreen-inline-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ds-accent);
    border: none;
    color: var(--ds-accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(var(--ds-accent-rgb), 0.3);
    flex-shrink: 0;
}

.fullscreen-inline-send:hover {
    background: var(--ds-accent);
    transform: scale(1.05);
}

.fullscreen-inline-send:disabled {
    background: var(--ds-line-strong);
    cursor: not-allowed;
    box-shadow: none;
}

.fullscreen-inline-cancel {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(var(--ds-ink-rgb), 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    flex-shrink: 0;
}

.fullscreen-inline-cancel:hover {
    background: rgba(var(--ds-danger-rgb), 0.2);
    color: var(--ds-danger);
}

/* Fullscreen Edit History Strip (for results section) */
/* Fullscreen Edit History Strip (for results section) */
.fullscreen-edit-history {
    position: absolute;
    /* Inside image, at top as requested */
    top: 20px;
    bottom: auto;
    /* Ensure bottom is unset */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 20;
}

.fs-edit-thumb {
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    /* visible for badge to show outside */
    overflow: visible;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    display: block;
}

.fs-edit-thumb:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.fs-edit-thumb.active {
    border-color: var(--ds-accent);
    box-shadow: 0 0 0 2px rgba(var(--ds-accent-rgb), 0.4);
}

.fs-edit-thumb.original {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.7);
}

/* Image inside thumbnail - force square crop */
.fs-edit-thumb img {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 6px;
}

/* Number badge on thumbnail */
.fs-edit-thumb::after {
    content: attr(data-index);
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--ds-accent);
    color: var(--ds-accent-ink);
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.fs-edit-thumb.original::after {
    content: "⬤";
    background: var(--ds-ok);
    font-size: 6px;
}

/* ============================================
   16. Gallery Lightbox Inline Edit
   ============================================ */

/* Position FIXED to overlay exactly on action bar position - prevents sliding animation */
.lightbox-inline-edit {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    /* Match action bar styling exactly */
    background: var(--ds-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 9999px;
    padding: 6px 12px;
    border: 1px solid rgba(var(--ds-ink-rgb), 0.08);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 0, 0, 0.2);
    z-index: 4010;
    /* Match action bar height */
    min-height: 52px;
}

/* LB Edit Perspective Button (standalone, leftmost) */
.lb-edit-perspective-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--ds-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    flex-shrink: 0;
}

.lb-edit-perspective-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--ds-on-media);
}

.lb-edit-model-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.lb-edit-model-btn {
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 18px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ds-on-media);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.lb-edit-model-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lb-edit-model-btn i:first-child {
    color: var(--ds-accent);
}

.lb-edit-model-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: rgba(var(--ds-accent-rgb), 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10000;
}

.lb-edit-model-selector.open .lb-edit-model-dropdown {
    display: block;
}

.lb-edit-model-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.15s;
}

.lb-edit-model-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lb-edit-model-option.active {
    background: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-light);
}

.lb-edit-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.lb-edit-tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(var(--ds-ink-rgb), 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    flex-shrink: 0;
}

.lb-edit-tool-btn:hover {
    background: rgba(var(--ds-ink-rgb), 0.1);
    color: var(--ds-ink);
}

.lb-edit-tool-btn.active {
    background: rgba(var(--primary-color-rgb), 0.2);
    color: var(--primary-light);
}

.lb-edit-tool-btn.hidden {
    display: none !important;
}

.lb-edit-input {
    flex: 1;
    min-width: 180px;
    max-width: 350px;
    background: transparent;
    border: none;
    color: var(--ds-on-media);
    font-size: 14px;
    padding: 8px 12px;
    outline: none;
}

.lb-edit-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.lb-edit-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ds-accent);
    border: none;
    color: var(--ds-accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(var(--ds-accent-rgb), 0.3);
    flex-shrink: 0;
}

.lb-edit-send:hover {
    background: var(--ds-accent);
    transform: scale(1.05);
}

.lb-edit-send:disabled {
    background: var(--ds-line-strong);
    cursor: not-allowed;
    box-shadow: none;
}

.lb-edit-cancel {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.lb-edit-cancel:hover {
    background: rgba(var(--ds-danger-rgb), 0.2);
    color: var(--ds-danger);
}

/* ============================================
   17. Edit Mode Toggle Icons
   Floating circular icons on left side in Edit mode
   Controls visibility of panels without breaking functionality
   ============================================ */

/* Container for toggle icons - only visible in Edit mode */
.edit-mode-toggle-container {
    position: fixed;
    left: 70px;
    /* Right after collapsed sidebar (~60px) */
    top: 50%;
    transform: translateY(-50%);
    display: none;
    /* Hidden by default, shown via JS in edit mode */
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
    padding: 10px;
    background: rgba(255, 255, 255, 0.06);
    /* Match edit bar background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Toggle icon button base style */
.edit-toggle-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(var(--ds-ink-rgb), 0.06);
    border: 1px solid rgba(var(--ds-ink-rgb), 0.1);
    color: rgba(var(--ds-ink-rgb), 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    position: relative;
}

.edit-toggle-icon-btn:hover {
    background: rgba(var(--ds-ink-rgb), 0.12);
    color: var(--ds-ink);
    transform: scale(1.08);
    border-color: rgba(var(--ds-ink-rgb), 0.2);
}

/* Active state - panel is visible */
.edit-toggle-icon-btn.active {
    background: rgba(var(--ds-accent-rgb), 0.2);
    color: var(--ds-accent);
    border-color: rgba(var(--ds-accent-rgb), 0.4);
    box-shadow: 0 0 16px rgba(var(--ds-accent-rgb), 0.2);
}

.edit-toggle-icon-btn.active:hover {
    background: rgba(var(--ds-accent-rgb), 0.3);
    color: var(--ds-accent);
}

/* Tooltip for toggle icons */
.edit-toggle-icon-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(var(--ds-accent-rgb), 0.95);
    color: var(--ds-accent-ink);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.edit-toggle-icon-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
}

/* Floating panels in edit mode */
.edit-floating-panel {
    position: fixed;
    left: 140px;
    /* After toggle bar (70px + 60px width + 10px gap) */
    top: 50%;
    transform: translateY(-50%) translateX(-20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    max-height: 80vh;
    overflow: visible;
}

.edit-floating-panel.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

/* Specific floating panel styling - Match Edit Bar colors */
.edit-floating-panel .panel-card {
    background: rgba(var(--ds-surface-rgb), 0.95);
    /* Dark background like edit bar */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(var(--ds-ink-rgb), 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    width: 420px;
    /* Wider panel */
    max-width: 90vw;
    margin: 0;
    border-radius: 20px;
    overflow: visible;
}

.edit-floating-panel .panel-card .card-header {
    background: rgba(var(--ds-ink-rgb), 0.02);
    border-bottom: 1px solid rgba(var(--ds-ink-rgb), 0.06);
    padding: 14px 18px;
    border-radius: 20px 20px 0 0;
}

.edit-floating-panel .panel-card .card-header h3 {
    color: rgba(var(--ds-ink-rgb), 0.9);
    font-size: 0.9rem;
}

.edit-floating-panel .panel-card .card-header h3 i {
    color: var(--ds-accent);
    /* Orange accent */
}

/* Generation container in floating panel */
.edit-floating-panel .generation-container {
    padding: 16px 18px;
    overflow: visible;
}

/* Primary row - model, aspect, + buttons */
.edit-floating-panel .generation-primary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    overflow: visible;
}

/* Model settings row */
.edit-floating-panel .generation-model-row {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Compact selects styling in floating panel */
.edit-floating-panel .compact-select-toggle,
.edit-floating-panel .compact-plus-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.edit-floating-panel .compact-select-toggle:hover,
.edit-floating-panel .compact-plus-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Dropdown menus inside floating panel */
.edit-floating-panel .compact-select-menu {
    background: rgba(var(--ds-surface-rgb), 0.98);
    border: 1px solid rgba(var(--ds-ink-rgb), 0.1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.edit-floating-panel .compact-select-option {
    color: rgba(255, 255, 255, 0.8);
}

.edit-floating-panel .compact-select-option:hover {
    background: rgba(var(--ds-accent-rgb), 0.15);
}

.edit-floating-panel .compact-select-option.active {
    background: rgba(var(--ds-accent-rgb), 0.2);
    color: var(--ds-accent);
}

/* Seed container in floating panel */
.edit-floating-panel .seed-container {
    flex-shrink: 0;
}

.edit-floating-panel .seed-embedded-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Model usage button */
.edit-floating-panel .model-usage-button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
}

.edit-floating-panel .model-usage-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Batch toggle button */
.edit-floating-panel .compact-toggle-button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.edit-floating-panel .compact-toggle-button.active {
    background: rgba(var(--ds-accent-rgb), 0.2);
    border-color: rgba(var(--ds-accent-rgb), 0.4);
    color: var(--ds-accent);
}

/* Style shelf in floating styles panel */
.edit-floating-panel .style-shelf {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 18px;
}

.edit-floating-panel .style-category-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.edit-floating-panel .style-category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--ds-on-media);
}

.edit-floating-panel .style-category-btn.active,
.edit-floating-panel .style-category-btn.selected {
    background: rgba(var(--ds-accent-rgb), 0.2);
    border-color: rgba(var(--ds-accent-rgb), 0.4);
    color: var(--ds-accent);
}

/* Input prompt styling */
.edit-floating-panel .generation-prompt-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.edit-floating-panel .generation-prompt-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.edit-floating-panel .generation-prompt-input:focus {
    border-color: rgba(var(--ds-accent-rgb), 0.5);
    box-shadow: 0 0 0 2px rgba(var(--ds-accent-rgb), 0.1);
}

/* Mobile adjustments for toggle icons */
@media (max-width: 768px) {
    .edit-mode-toggle-container {
        left: 10px;
        gap: 12px;
        padding: 10px;
    }

    .edit-toggle-icon-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .edit-floating-panel {
        left: 70px;
    }

    .edit-floating-panel .panel-card {
        width: 320px;
    }

    /* Hide tooltips on mobile */
    .edit-toggle-icon-btn::after {
        display: none;
    }
}

/* ============================================
   FIXES FOR FULLSCREEN EDIT & MODALS
   ============================================ */

/* 1. Prevent layout shift in Fullscreen Edit Bar */
.fullscreen-actions {
    min-height: 52px !important;
    /* Ensure container keeps height */
    position: absolute !important;
    bottom: 30px !important;
    width: auto !important;
    min-width: 300px;
    z-index: 10020 !important;
    /* Ensure actions are above everything */
}

/* Position inline edit inside fullscreen-actions - inherit parent styling */
.fullscreen-inline-edit {
    /* Stay in normal flow inside parent, no absolute positioning */
    position: static !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    /* Transparent - inherits from parent .fullscreen-actions */
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    padding: 0 4px;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* 3. Mask Editor & Outpaint Panel Visibility Fix */
/* Ensure these editors appear ABOVE the fullscreen modal (z-index > 10000) */
.mask-editor-overlay,
.mask-editor-container,
.outpaint-container,
.outpaint-panel {
    z-index: 11000 !important;
}

/* 5. Fix Model Dropdown Z-Index in Fullscreen */
.fs-edit-model-dropdown {
    z-index: 11001 !important;
    /* Above modal and other UI */
}

/* Ensure fullscreen image is clickable for zoom */
.fullscreen-img-wrapper img {
    cursor: zoom-in;
    pointer-events: auto !important;
    /* Ensure clicks are registered */
}

.fullscreen-img-wrapper.zoomed img {
    cursor: zoom-out;
}

/* ============================================
   Style Browser Modal v6.0 UI
   ============================================ */

/* Main Category Grid */
.style-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    padding: 10px;
    width: 100%;
}

/* Category Card Styling */
.style-category-card {
    background: rgba(40, 40, 45, 0.5);
    border: 1px solid rgba(var(--ds-ink-rgb), 0.08);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    aspect-ratio: 1.3;
    overflow: hidden;
}

.style-category-card:hover {
    background: rgba(var(--ds-surface-rgb), 0.94);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.style-category-card .cat-icon {
    font-size: 22px;
    color: rgba(var(--ds-ink-rgb), 0.6);
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.style-category-card:hover .cat-icon {
    color: var(--primary-color);
}

.style-category-card .cat-info h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.style-category-card .cat-info p {
    font-size: 10px;
    color: rgba(var(--ds-ink-rgb), 0.4);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.style-category-card .cat-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary-color);
    color: var(--ds-accent-ink);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.style-category-card .cat-arrow {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 10px;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s ease;
    color: rgba(var(--ds-ink-rgb), 0.3);
}

.style-category-card:hover .cat-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Style Card Image & Text Layout Fixes */
.style-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-on-media);
    margin-bottom: 2px;
}

.style-card-desc {
    font-size: 10px;
    color: var(--ds-muted);
    line-height: 1.2;
    display: none;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.2);
    font-size: 24px;
}