:root {
    --bg-color: #000000;
    --text-color: #f5f5f7;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-heavy: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.2);
    --accent-color: #007aff;
    --blur-amount: 30px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    overflow: hidden;
}

/* --- SLIDESHOW (Premium Blurred Background) --- */
#slideshow-container {
    position: relative;
    width: 100%;
    height: 75dvh;
    /* Adjusted for mobile address bars */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #000;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

/* Layer 1: Background Blur (Fills gap) */
.slide-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.5);
    transform: scale(1.1);
    /* Prevent blur edges */
}

/* Layer 2: Main Image (Sharp, Contained) */
.slide-img {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

/* --- FOOTER / QR --- */
.footer-qr-section {
    height: 25dvh;
    /* Remaining space */
    width: 100%;
    background: #0a0a0a;
    border-top: 1px solid #222;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 10px;
    /* Reduced gap further */
    padding: 5px;
    justify-content: center;
    /* Center them together instead of spacing evenly */
}

.footer-qr-section a.qr-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    width: auto;
    height: 100%;
    flex: 0 1 auto;
    /* Don't stretch too much */
    max-width: 48%;
    /* Increased slightly from 40% */
}

.qr-code {
    max-height: 130px;
    /* Increased from 100px */
    width: auto;
    max-width: 100%;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.side-img {
    height: auto;
    max-height: 170px;
    /* Increased from 140px */
    max-width: 48%;
    /* Increased from 45% */
    flex: 0 1 auto;
    object-fit: contain;
}

.footer-qr-section a:hover .qr-code {
    transform: scale(1.05);
}

.qr-label {
    font-size: 0.9rem;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* --- GALLERY (Liquid Glass Cards) --- */
body.gallery-mode {
    overflow-y: auto;
    padding: 20px;
    height: auto;
    /* Allow scrolling */
    min-height: 100dvh;
}

header {
    margin-bottom: 30px;
    text-align: center;
    padding-top: 20px;
}

h1 {
    font-weight: 800;
    font-size: 1.5rem;
    /* Reduced for mobile safety */
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
    padding: 0 10px;
}

.subtitle a {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #333;
}

/* SEARCH SECTION */
.search-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    margin-bottom: 25px;
}

.glass-input {
    width: 50px;
    /* Slightly smaller for better mobile fit */
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-size: 1.5rem;
    text-align: center;
    font-weight: 700;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    outline: none;
    transition: all 0.3s ease;
    caret-color: var(--accent-color);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.1);
}

.back-link {
    display: inline-block;
    margin-top: 10px;
    color: #555;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 8px 16px;
    border: 1px solid #333;
    border-radius: 20px;
    transition: 0.3s;
}

.back-link:hover {
    border-color: #fff;
    color: #fff;
}

/* Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    /* Prevent blowout */
    gap: 20px;
    padding-bottom: 60px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 800px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile Optimizations */
@media (max-width: 500px) {
    .gallery-grid {
        gap: 15px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0;
    }

    body.gallery-mode {
        padding: 12px;
    }
}

/* Card Style */
.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Space between img and text */
}

.img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    /* Vertical Photo Box */
    border-radius: 12px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    /* Glass border */
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

/* REAL Liquid Glass Button */
.glass-download-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    height: 40px;
    border-radius: 20px;
    /* Pill shape */

    /* True Glass Effect */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);

    /* Lighting borders */
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

    /* Interior sheen */
    box-shadow:
        inset 0 0 15px rgba(255, 255, 255, 0.05),
        0 4px 10px rgba(0, 0, 0, 0.3);

    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.gallery-item:hover .img-wrapper img {
    transform: scale(1.03);
}

.glass-download-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

/* Filename Subtle Style */
.file-name {
    font-size: 0.75rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 4px;
    font-weight: 500;
    text-align: center;
}