﻿/* Global Color System Variables */
:root {
    --bg-primary: #f8fafc;
    --sidebar-gradient: linear-gradient(135deg, #1e1b4b 0%, #311042 100%);
    --text-light: #ffffff;
    --text-muted-light: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-color: #6366f1;
    --active-gradient: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
    --border-color: #e2e8f0;
    --navbar-height: 70px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-main);
    padding-top: var(--navbar-height);
}

/* ==========================================================================
       FIXED TOP NAVBAR STYLING
       ========================================================================== */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--navbar-height);
    /* Base Glass Container matching Apple's toolbar */
    background: linear-gradient(90deg, #161617 0%, #1e1e24 40%, #4e54c8 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);    
    box-shadow: 0 4px 30px rgba(0, 242, 254, 0.15); /* Soft neon floor glow */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 900;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 80px;
    height: 34px;
    background: var(--active-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #dedde8, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

    .nav-links a {
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.95rem;
        font-weight: 600;
        transition: var(--transition);
        padding: 0.5rem 0.75rem;
        border-radius: var(--radius-sm);
    }

        .nav-links a:hover, .nav-links a.active {
            color: var(--accent-color);
            background-color: #f1f5f9;
        }

/* Outer Wrapper for Body split grid layout */
.gallery-container {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
}

/* ==========================================================================
       SIDEBAR
       ========================================================================== */
.sidebar {
    width: 320px;
    background: var(--sidebar-gradient);
    padding: 2rem 1.25rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 5px 0 30px rgba(30, 27, 75, 0.15);
    position: relative;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #a5b4fc;
    margin: 0 0 1rem 0.5rem;
}

.album-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.album-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

    .album-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        transform: translateX(6px);
    }

    .album-item.active {
        background: var(--active-gradient);
        border-color: transparent;
        box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
    }

.album-link-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.album-icon {
    font-size: 1.35rem;
    display: inline-flex;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.album-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted-light);
    transition: var(--transition);
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.album-item.active .album-name {
    color: var(--text-light);
}

.album-count {
    font-size: 0.8rem;
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.1);
    color: #c7d2fe;
    padding: 3px 10px;
    border-radius: 30px;
    transition: var(--transition);
}

.album-item.active .album-count {
    background-color: rgba(255, 255, 255, 0.25);
    color: var(--text-light);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ec4899;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
}

.user-role {
    font-size: 0.8rem;
    color: #a5b4fc;
}

/* ==========================================================================
       MAIN CONTENT PANEL
       ========================================================================== */
.main-content {
    flex-grow: 1;
    padding: 3rem;
    overflow-y: auto;
}

.gallery-header {
    margin-bottom: 3rem;
}

    .gallery-header h1 {
        font-size: 2.5rem;
        font-weight: 900;
        color: var(--text-main);
        margin: 0 0 0.5rem 0;
        text-transform: capitalize;
        letter-spacing: -0.75px;
    }

.header-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 2.5rem;
}

.photo-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

    .photo-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 25px 35px -5px rgba(99, 102, 241, 0.15), 0 15px 15px -5px rgba(15, 23, 42, 0.05);
    }

.image-wrapper {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #e2e8f0;
}

    .image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    }

.photo-card:hover .image-wrapper img {
    transform: scale(1.08);
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(236, 72, 153, 0.4) 100%);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.view-btn {
    background: #ffffff;
    color: #4f46e5;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    transform: translateY(10px);
    transition: var(--transition);
}

.photo-card:hover .view-btn {
    transform: translateY(0);
}

.photo-details {
    padding: 1.5rem;
    border-top: 3px solid #f1f5f9;
    transition: var(--transition);
}

.photo-card:hover .photo-details {
    border-top-color: #ec4899;
}

.photo-details h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
}

.loader {
    text-align: center;
    padding: 5rem 2rem;
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.1rem;
}

/* ==========================================================================
       LIGHTBOX STYLING
       ========================================================================== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

    .lightbox.active {
        opacity: 1;
        pointer-events: auto;
    }

.lightbox-content {
    position: relative;
    max-width: 85%;
    max-height: 80%;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img {
    width: 100%;
    height: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-title {
    color: white;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: capitalize;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
}

@media (max-width: 900px) {
    .top-navbar {
        padding: 0 1.25rem;
    }

    .nav-links {
        gap: 0.75rem;
    }

        .nav-links a {
            font-size: 0.85rem;
            padding: 0.4rem 0.6rem;
        }

    .gallery-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        padding: 1.75rem;
    }
}
