/* ===== LIGHTBOX & MODAL STYLES ===== */

/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.3s ease-out;
}

.lightbox-close {
    position: absolute;
    top: -3rem;
    right: 0;
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    border: none;
}

.lightbox-close:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.lightbox-nav:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: -4rem;
}

.lightbox-next {
    right: -4rem;
}

.lightbox-counter {
    position: absolute;
    bottom: -3rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.5);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== MODAL ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE LIGHTBOX ===== */
@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95vw;
        max-height: 80vh;
        margin: 2rem auto;
    }

    .lightbox-close {
        top: -2rem;
        right: -1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }

    .lightbox-nav {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }

    .lightbox-prev {
        left: -3rem;
    }

    .lightbox-next {
        right: -3rem;
    }

    .lightbox-counter {
        bottom: -2.5rem;
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-sm);
    }
}

@media (max-width: 480px) {
    .lightbox-content {
        max-width: 100vw;
        max-height: 70vh;
        margin: 1rem auto;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
        position: fixed;
    }

    .lightbox-nav {
        top: 50%;
        transform: translateY(-50%);
        position: fixed;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }

    .lightbox-counter {
        bottom: 1rem;
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ===== THEME TOGGLE MODAL ===== */
.theme-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease-out;
}

.theme-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-modal-content {
    background: var(--bg-primary);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
    animation: slideInUp 0.3s ease-out;
    border: 1px solid var(--text-muted);
}

.theme-modal h3 {
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-md);
}

.theme-option {
    background: var(--bg-secondary);
    border: 2px solid transparent;
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.theme-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.theme-option i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.theme-option span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== LOADING STATES ===== */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    backdrop-filter: blur(2px);
}

.loading-content {
    background: var(--bg-primary);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--text-muted);
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

.loading-text {
    color: var(--text-secondary);
    font-weight: 500;
}
