@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #090d16;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-sidebar: #0b1120;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    
    --secondary: #a855f7;
    --secondary-hover: #9333ea;
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    
    --glass-blur: blur(12px);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Layout Estrutural */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding-left: 0.5rem;
}

.sidebar-logo img {
    height: 36px;
    width: auto;
}

.sidebar-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Projeto Selector no Sidebar */
.project-selector-container {
    margin-bottom: 2rem;
}

.project-selector {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.project-selector:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 0.25rem;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(3px);
}

.sidebar-item.active a {
    color: var(--text-primary);
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.sidebar-item.active a svg {
    stroke: var(--text-primary);
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Painel Principal */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

.app-header {
    height: 75px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(9, 13, 22, 0.8);
    backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-title h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Layout de Conteúdo */
.content-wrapper {
    padding: 2.5rem;
    flex-grow: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Cards e Contêineres Premium */
.card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--shadow-premium);
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-smooth);
}

.card-premium:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-premium.hover-glow:hover {
    box-shadow: 0 15px 35px -10px rgba(99, 102, 241, 0.15), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
    border-color: rgba(99, 102, 241, 0.3);
}

/* Grid Sistêmico */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Grade de miniaturas (galeria de lote) — independente da largura da viewport,
   reage à largura real do container em vez de colapsar pra 1 coluna como o .grid-2 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

@media (max-width: 1024px) {
    .grid-4, .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Tipografia e Títulos */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

/* Botões */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* Inputs de Formulários */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.015em;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Corrigir contraste de dropdowns (select option) no tema escuro */
select option {
    background-color: #0f172a;
    color: #f8fafc;
}
select option:hover {
    background-color: #6366f1;
    color: #ffffff;
}


textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.table-premium th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.table-premium td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.table-premium tr:last-child td {
    border-bottom: none;
}

.table-premium tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges e Status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
}

/* Notificação Flash / Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Estilo para Itens da Biblioteca */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.library-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.library-preview {
    height: 180px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.library-preview img, .library-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.library-details {
    padding: 1rem 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.library-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* Modais */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

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

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 550px;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==========================================================================
   Grid Helpers & Flex Utilities
   ========================================================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.5rem;
    margin-left: -0.5rem;
}

.row.g-2 {
    margin-right: -0.25rem;
    margin-left: -0.25rem;
}

.row.g-2 > * {
    padding-right: 0.25rem;
    padding-left: 0.25rem;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }

/* ==========================================================================
   Navegação Mobile & Sidebar Drawer
   ========================================================================== */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.mobile-sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: var(--transition-smooth);
}

.mobile-sidebar-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   Tabs de Geração (Scroll Horizontal no Mobile)
   ========================================================================== */
.gen-tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.gen-tabs-container::-webkit-scrollbar {
    display: none;
}

.gen-tab-btn {
    flex: 1 0 auto;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    white-space: nowrap;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 42px;
}

/* ==========================================================================
   Barra de Ações em Lote e Galeria
   ========================================================================== */
.batch-actions-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.batch-card-img-wrap {
    cursor: pointer;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.batch-card-img-wrap:hover {
    border-color: var(--primary);
    transform: scale(1.01);
}

.batch-card-img-wrap .tap-zoom-hint {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 3px;
    pointer-events: none;
}

.btn-icon-touch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 38px;
    border-radius: 8px;
}

/* ==========================================================================
   Toast de Notificação / Progresso de Download
   ========================================================================== */
#download-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: #0f172a;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), 0 0 15px var(--primary-glow);
    padding: 1rem 1.25rem;
    border-radius: 14px;
    z-index: 10001;
    max-width: 90vw;
    width: 420px;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    opacity: 0;
}

#download-toast.active {
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    opacity: 1;
}

#download-toast .toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#download-toast .toast-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

#download-toast .toast-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.25s ease;
}

/* ==========================================================================
   Media Queries para Dispositivos Móveis e Tablets
   ========================================================================== */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .app-container {
        flex-direction: column;
        min-height: 100vh;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    /* Sidebar vira Drawer deslizante no Mobile */
    .app-sidebar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 290px;
        max-width: 85vw;
        height: 100vh;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        overflow-y: auto;
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.7);
    }

    .mobile-sidebar-close {
        display: flex;
    }

    .app-main {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        width: 100%;
    }

    .app-header {
        height: 60px;
        padding: 0 1rem;
        gap: 0.75rem;
    }

    .header-title h2 {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 220px;
    }

    .header-actions {
        gap: 0.5rem;
    }

    /* Padding de tela ajustado para aproveitar espaço */
    .content-wrapper {
        padding: 1rem 0.75rem 3rem 0.75rem;
        width: 100%;
    }

    .card-premium {
        padding: 1.15rem;
        border-radius: 14px;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    /* Galeria com 2 colunas nítidas no celular */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    /* Previne auto-zoom indesejado no iOS Safari ao focar campos */
    .form-control, select, textarea, input {
        font-size: 16px !important;
    }

    /* Botões com área de toque confortável no celular */
    .btn-premium {
        min-height: 44px;
        padding: 0.65rem 1rem;
    }

    .batch-actions-toolbar .btn-premium {
        flex: 1 1 calc(50% - 0.25rem);
        min-height: 42px;
        font-size: 0.8rem;
    }

    .modal-content {
        max-width: 95% !important;
        padding: 1.25rem !important;
        border-radius: 16px !important;
    }
}

@media (max-width: 480px) {
    .header-title h2 {
        max-width: 170px;
        font-size: 0.95rem;
    }

    .batch-actions-toolbar .btn-premium {
        flex: 1 1 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }
}

/* ==========================================================================
   Image Lightbox Modal (Mobile & Desktop)
   ========================================================================== */
#image-lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 29, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
    box-sizing: border-box;
}

#image-lightbox-modal.active {
    display: flex;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0.25rem 0;
    color: var(--text-primary);
    z-index: 2;
}

.lightbox-header .lightbox-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lightbox-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.lightbox-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border-color);
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.lightbox-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.lightbox-nav-btn.prev {
    left: 0.5rem;
}

.lightbox-nav-btn.next {
    right: 0.5rem;
}

#lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.05);
}

.lightbox-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0.5rem 0;
    z-index: 2;
}

#lightbox-caption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    max-height: 46px;
    overflow-y: auto;
    max-width: 100%;
    padding: 0 1rem;
    line-height: 1.35;
}

.lightbox-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

