:root {
    --bg-color: #050505;
    /* Deeper, richer black */
    --card-bg: rgba(25, 25, 25, 0.4);
    --text-primary: #f8f8f8;
    --text-secondary: #aaaaaa;
    --accent: #e5b362;
    /* Refined champagne gold */
    --accent-hover: #fce6a9;
    --error: #ff4d4d;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* Smoother premium easing */
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   LOGIN PAGE STYLING
   ========================================================================== */
.login-page {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #111115 0%, #050505 100%);
    position: relative;
    /* For canvas positioning */
}

#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.login-container {
    text-align: center;
    padding: 3.5rem 2.5rem;
    background: rgba(20, 20, 22, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 420px;
    animation: slideUpFade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    z-index: 1;
    /* Above particles */
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

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

.login-container h1 {
    font-weight: 300;
    font-size: 3.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
    background: linear-gradient(180deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-container p {
    color: var(--accent);
    margin-bottom: 3rem;
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 0.8rem;
    opacity: 0.8;
}

.input-group {
    display: flex;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--transition);
    padding-bottom: 5px;
}

.input-group:focus-within {
    border-bottom-color: var(--accent);
    transform: translateY(-2px);
}

input[type="password"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 10px 0;
    font-size: 1.2rem;
    width: 100%;
    outline: none;
    letter-spacing: 3px;
    font-family: monospace;
    /* Adds to the "secret" feel */
}

input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 1px;
    font-size: 1rem;
    font-family: var(--font-main);
}

button#submitBtn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button#submitBtn:hover {
    color: var(--accent);
    transform: translateX(5px) scale(1.1);
}

#error-message {
    color: var(--error);
    margin-top: 1.5rem;
    font-size: 0.85rem;
    height: 1.2em;
    opacity: 1;
    transition: opacity 0.3s;
    letter-spacing: 1px;
}

#error-message.hidden {
    opacity: 0;
}

/* ==========================================================================
   GALLERY PAGE STYLING
   ========================================================================== */
.gallery-page header {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-weight: 300;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

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

.header-link,
#logoutBtn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    padding: 8px 24px;
    border-radius: 40px;
    /* Pill shape */
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-link:hover,
#logoutBtn:hover {
    border-color: var(--accent);
    color: var(--bg-color);
    background: var(--accent);
    box-shadow: 0 0 15px rgba(229, 179, 98, 0.3);
}

/* Album Filter Navigation */
.album-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 5px;
    /* Room for scrollbar if many albums */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.album-nav::-webkit-scrollbar {
    height: 4px;
}

.album-nav::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.album-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 6px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: var(--transition);
    white-space: nowrap;
}

.album-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

.album-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

main {
    padding: 3rem 5%;
    flex: 1;
}

/* MASONRY LAYOUT */
.gallery-grid {
    column-count: 4;
    column-gap: 20px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    /* Slightly sharper, more editorial corners */
    margin-bottom: 20px;
    overflow: hidden;
    cursor: pointer;
    background: var(--card-bg);
    transition: var(--transition);
    break-inside: avoid;
    /* Prevents images splitting across columns */
    display: block;
    /* Important for masonry */
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    /* Allow natural aspect ratios */
    display: block;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s;
}

/* Premium Hover Effect */
.gallery-item::after {
    content: 'VIEW';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 100%);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 4px;
    font-weight: 300;
    transition: var(--transition);
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.03);
    filter: brightness(0.8);
}

/* Placeholder loading state */
.loading {
    aspect-ratio: 3/4;
    /* Give loaders a shape before images load */
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        background-color: rgba(25, 25, 25, 0.4);
    }

    50% {
        background-color: rgba(40, 40, 40, 0.6);
    }

    100% {
        background-color: rgba(25, 25, 25, 0.4);
    }
}

/* ==========================================================================
   ADVANCED LIGHTBOX
   ========================================================================== */
.lightbox {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.98);
    /* Pitch black for maximum contrast */
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.lightbox.hidden {
    opacity: 0;
    pointer-events: none;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    object-fit: contain;
}

.lightbox:not(.hidden) .lightbox-content.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Top Controls (Close & Slideshow) */
.lightbox-controls-top {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 1001;
}

.close-lightbox,
.lightbox-btn {
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-lightbox {
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
}

.lightbox-btn svg {
    width: 28px;
    height: 28px;
}

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

.lightbox-btn.playing {
    color: var(--accent);
}

/* Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    z-index: 1001;
    left: 30px;
}

.lightbox-nav.right {
    left: auto;
    right: 30px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

@keyframes fadeInReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Responsive Rules */
@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }

    .login-container {
        padding: 3rem 2rem;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        column-count: 1;
        gap: 15px;
    }

    .gallery-item {
        margin-bottom: 15px;
    }

    .login-container h1 {
        font-size: 2.5rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-nav svg {
        width: 24px;
        height: 24px;
    }

    .lightbox-nav {
        left: 10px;
    }

    .lightbox-nav.right {
        right: 10px;
    }
}