:root {
    --bg-color: #fbfbfc;
    --text-primary: #111111;
    --text-secondary: #71717a;
    --card-bg: #ffffff;
    --border-color: #e4e4e7;
    --accent: #000000;
    --star-color: #f59e0b;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-pill: 999px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --modal-bg: rgba(255, 255, 255, 0.98);
}

[data-theme="dark"] {
    --bg-color: #111111;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --card-bg: #18181b;
    --border-color: #27272a;
    --accent: #ffffff;
    --modal-bg: rgba(10, 10, 10, 0.98);
}

[data-theme="dark"] ::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-stack); background-color: var(--bg-color); color: var(--text-primary); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-y: scroll; display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 100px; transition: background-color 0.3s, color 0.3s; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: transparent; }

hr { border: none !important; height: 48px !important; margin: 0 !important; background: transparent !important; }
main { flex-grow: 1; width: 100%; display: flex; flex-direction: column; }
.container { max-width: 1440px; width: 95%; margin: 0 auto; padding: 0; }

/* GLOBAL LOADER */
#global-loader { display: none; position: fixed; inset: 0; background: var(--modal-bg); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
#global-loader.active { display: flex; flex-direction: column; gap: 16px; }
.spinner { width: 48px; height: 48px; border: 4px solid var(--border-color); border-top: 4px solid var(--text-primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* HEADER (Untouched Pill Design) */
.header-wrapper { position: sticky; top: 0; z-index: 1000; background: var(--bg-color); margin-bottom: 48px; width: 100%; display: flex; justify-content: center; padding: 16px 0; transition: background-color 0.3s;}
.header { width: 95%; max-width: 1440px; position: relative; pointer-events: auto; display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; border: 1px solid var(--border-color); background: var(--bg-color); border-radius: var(--radius-pill); flex-wrap: wrap; transition: background-color 0.3s; }
.logo-wrapper { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; flex-shrink: 0;}
.logo-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.logo-icon { width: 32px; height: 32px; background: var(--text-primary); color: var(--bg-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: bold; }

.theme-toggle { background: transparent; border: none; color: var(--text-primary); padding: 8px; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.2s;}
.theme-toggle:hover { background: var(--border-color); }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }

/* FOOTER (Untouched Pill Design) */
.site-footer { position: fixed; bottom: 24px; left: 0; right: 0; z-index: 1000; width: 100%; pointer-events: none; display: flex; justify-content: center; padding: 0 16px; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease; }
.footer-inner { display: flex; align-items: center; gap: 16px; background: var(--bg-color); padding: 12px 24px; border-radius: var(--radius-pill); border: 1px solid var(--border-color); pointer-events: auto; flex-wrap: wrap; justify-content: center; transition: background-color 0.3s; }
.footer-links { display: flex; align-items: center; gap: 16px; }
.footer-links a { color: var(--text-primary); font-size: 13px; font-weight: 600; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 0.6; }
.footer-divider { width: 4px; height: 4px; background: var(--border-color); border-radius: 50%; }

/* MOBILE MENU TOGGLE */
.mobile-menu-toggle { display: none; background: transparent; border: none; color: var(--text-primary); padding: 8px; cursor: pointer; border-radius: var(--radius-md); }
.mobile-menu-toggle:hover { background: var(--border-color); }
.header-actions { display: flex; align-items: center; justify-content: space-between; flex-grow: 1; margin-left: 32px; gap: 16px; }
.nav-links { display: flex; align-items: center; gap: 4px; }

/* SEARCH & HEADER LINKS */
.search-wrapper { position: relative; max-width: 300px; width: 100%; flex-grow: 1;}
.search-form { display: flex; align-items: center; background: transparent; border: none; border-radius: var(--radius-pill); padding: 6px 12px; width: 100%; transition: background-color 0.2s;}
.search-form:focus-within { background: rgba(0, 0, 0, 0.04); }
[data-theme="dark"] .search-form:focus-within { background: rgba(255, 255, 255, 0.08); }
.search-form input { border: none; outline: none; padding: 4px 8px; width: 100%; font-size: 14px; background: transparent; color: var(--text-primary);}

.header-divider { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 1px; height: 24px; background: var(--border-color); margin: 0; }

.header-link { color: var(--text-primary); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: var(--radius-pill); transition: background-color 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.header-link:hover { background: rgba(0,0,0,0.04); }
[data-theme="dark"] .header-link:hover { background: rgba(255,255,255,0.08); }

.search-dropdown { position: absolute; top: calc(100% + 8px); left: 0; width: 100%; background: var(--card-bg); border-radius: var(--radius-md); border: 1px solid var(--border-color); display: none; overflow: hidden; z-index: 200;}
.search-dropdown.active { display: block; }
.search-section { padding: 12px; border-bottom: 1px solid var(--border-color); }
.search-section:last-child { border-bottom: none; }
.search-title { font-size: 11px; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; margin-bottom: 8px; letter-spacing: 0.5px; }
.search-item { display: block; padding: 8px 12px; font-size: 14px; color: var(--text-primary); border-radius: 4px; transition: background 0.2s; }
.search-item:hover { background: var(--bg-color); }

/* BLACK BUTTONS */
.btn-black { background-color: var(--text-primary); color: var(--bg-color); padding: 14px 24px; border-radius: var(--radius-pill); font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; border: none; text-align: center;}
.btn-black:hover { opacity: 0.8; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-outline:hover { border-color: var(--text-primary); background: transparent; }
.btn-danger { background: transparent; color: #dc2626; border: 1px solid var(--border-color); padding: 6px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; transition: border-color 0.2s; }
.btn-danger:hover { border-color: #dc2626; }

/* MINIMALIST MESSAGES */
.flash-messages { margin-bottom: 24px; }
.flash { padding: 16px 20px; margin-bottom: 10px; font-size: 14px; border: none; border-left: 4px solid var(--text-primary); background: transparent; color: var(--text-primary); font-weight: 500;}
.flash.error { border-left-color: #dc2626; color: #dc2626; }

.toast-message { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); background: var(--text-primary); color: var(--bg-color); padding: 8px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none;}
.toast-message.show { opacity: 1; }

/* GRIDS */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }

/* === NEW CINEMATIC SESSION CARDS === */
.session-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); gap: 32px; }
.session-card { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/9; background: var(--border-color); transform: translateZ(0); }
.session-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.session-card:hover img { transform: scale(1.05); }

/* Transparent Overlay protecting the text inside the image */
.session-card-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%); display: flex; flex-direction: column; justify-content: space-between; padding: 24px; pointer-events: none; }
.session-card-badges { display: flex; justify-content: space-between; width: 100%; }

/* Glass badges inside the image */
.badge-glass { background: rgba(255,255,255,0.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: white; padding: 6px 12px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; border: 1px solid rgba(255,255,255,0.3); }
.badge-glass.dark { background: rgba(0,0,0,0.5); border: 1px solid rgba(0,0,0,0.5); }

.session-title { color: white; font-size: 28px; font-weight: 700; margin-bottom: 4px; line-height: 1.2; letter-spacing: -0.5px;}
.session-subtitle { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500; }

.hero { text-align: center; margin-bottom: 48px; padding-top: 24px; }
.hero h1 { font-size: 48px; font-weight: 700; letter-spacing: -1px; margin-bottom: 12px; }

/* SESSION PAGE HEADER & FLAT RULES */
.session-header-minimal { display: flex; align-items: center; gap: 32px; background: transparent; padding: 0 0 32px 0; border: none; margin-bottom: 24px; }
.session-thumbnail { width: 120px; height: 120px; border-radius: var(--radius-md); overflow: hidden; flex-shrink: 0; border: none; background: rgba(0,0,0,0.03); }
[data-theme="dark"] .session-thumbnail { background: rgba(255,255,255,0.04); }
.session-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.session-info { flex-grow: 1; }
.session-info h1 { font-size: 32px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.5px; line-height: 1.2; }
.session-meta-row { display: flex; gap: 24px; color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.color-pills-minimal { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pill-minimal { background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); padding: 6px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.rules-box { background: transparent; border: 1px solid var(--border-color); padding: 32px; border-radius: var(--radius-lg); margin-bottom: 48px; }
.rules-box h3 { font-size: 12px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; letter-spacing: 1px; font-weight: 700; }
.wildcard-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--text-primary); color: var(--bg-color); padding: 6px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; margin-bottom: 16px; }

/* BORDERLESS GALLERY CARDS */
.session-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.gallery-card { display: flex; flex-direction: column; gap: 12px; background: transparent; border: none; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.gallery-card:hover { transform: translateY(-4px); }
.gallery-card-header { padding: 0; display: flex; align-items: center; gap: 12px; border: none; }
.gallery-card-img-wrapper { position: relative; display: block; width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-lg); overflow: hidden;}
.gallery-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-photo-count { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: white; padding: 6px 12px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; border: none;}
.overlay-color-tag { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #000; padding: 6px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 6px; z-index: 10; border: none;}

/* INDIVIDUAL GALLERY DETAIL */
.gallery-detail-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; margin-bottom: 48px; align-items: center; }
.star-photo-container { aspect-ratio: 1; width: 100%; border-radius: var(--radius-lg); border: none; overflow: hidden; background: transparent; }
.star-photo-large { width: 100%; height: 100%; object-fit: cover; cursor: pointer; display: block; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);}
.star-photo-large:hover { transform: scale(1.02); }
.star-story-box { background: transparent; padding: 0; border: none; display: flex; flex-direction: column; justify-content: center; height: 100%;}
.star-story-box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--star-color); margin-bottom: 16px; font-weight: 600; }
.star-story-box p { font-size: 18px; line-height: 1.6; color: var(--text-primary); font-style: italic;}

/* BEAUTIFUL FLUID MASONRY GRID */
.photo-masonry { column-count: 3; column-gap: 24px; margin-bottom: 64px; }
.photo-masonry img { width: 100%; height: auto; display: block; margin-bottom: 24px; break-inside: avoid; border-radius: var(--radius-md); cursor: pointer; transition: transform 0.2s; border: none; }
.photo-masonry img:hover { transform: translateY(-4px); }

/* AVATARS */
.avatar-small { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background-color: var(--text-primary); color: var(--bg-color); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; text-transform: uppercase; flex-shrink: 0;}
.avatar-large { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; background-color: var(--text-primary); color: var(--bg-color); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; text-transform: uppercase; margin-bottom: 16px; }
.header-user-info { display: flex; align-items: center; gap: 12px; }

/* === TRUE EDITORIAL MINIMALISM FOR FORMS === */
.auth-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; margin-bottom: 120px;}
.auth-card { background: transparent; padding: 0; width: 100%; max-width: 100%; border: none; display: flex; flex-direction: column;}
.form-group { margin-bottom: 32px; position: relative; text-align: left; }

/* Underline Inputs (Magazine Style) */
.form-input { 
    width: 100%; 
    padding: 12px 0; 
    border: none; 
    border-bottom: 1px solid var(--border-color); 
    background: transparent; 
    color: var(--text-primary); 
    font-size: 16px; 
    outline: none; 
    transition: border-color 0.3s ease; 
    border-radius: 0;
}
.form-input:focus { border-bottom-color: var(--text-primary); }
textarea.form-input { resize: vertical; min-height: 100px; }

.btn-block { width: 100%; padding: 18px; justify-content: center; font-size: 16px; }

/* The Single Center Line Panel Grid */
.panel-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 80px; 
    margin-bottom: 64px; 
    align-items: stretch;
    position: relative;
}
@media (min-width: 901px) {
    .panel-grid::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 1px;
        background: var(--border-color);
        transform: translateX(-50%);
    }
}

.responsive-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.responsive-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }

/* CUSTOM SESSION SEARCH SELECT */
.custom-select-wrapper { position: relative; width: 100%; }
.custom-select-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--radius-md); max-height: 250px; overflow-y: auto; z-index: 200; display: none;}
.custom-select-dropdown.active { display: block; }
.custom-select-option { padding: 16px 20px; font-size: 14px; cursor: pointer; transition: background 0.2s; border-bottom: 1px solid var(--border-color); }
.custom-select-option:last-child { border-bottom: none; }
.custom-select-option:hover { background: var(--border-color); }

/* FILE UPLOAD & PREVIEWS */
.file-drop-area { border: 1px dashed var(--border-color); border-radius: var(--radius-lg); padding: 64px 32px; text-align: center; cursor: pointer; background: transparent; transition: border-color 0.3s ease; display: block;}
.file-drop-area:hover { border-color: var(--text-primary); }
.file-drop-icon { font-size: 48px; margin-bottom: 16px; display: block; }
#preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; margin-top: 16px; }
.preview-item { aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s; position: relative;}
.preview-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.preview-item.selected { border-color: var(--text-primary); }
.preview-item.selected img { opacity: 1; }
.preview-item.selected::after { content: '★ Star Photo'; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); background: var(--text-primary); color: var(--bg-color); font-size: 10px; padding: 2px 6px; border-radius: var(--radius-pill); font-weight: bold;}
.remove-photo-btn { position: absolute; top: 6px; right: 6px; background: rgba(220, 38, 38, 0.9); color: white; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; transition: background 0.2s;}
.remove-photo-btn:hover { background: #b91c1c; }

/* MODAL WITH EXIF & SWIPE NAVIGATION */
.modal { display: none; position: fixed; inset: 0; background: var(--modal-bg); z-index: 1000; align-items: center; justify-content: center; flex-direction: column; }
.modal.active { display: flex; }
.modal-nav { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; border: 1px solid var(--border-color); color: var(--text-primary); width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color 0.2s; z-index: 1010; }
.modal-nav:hover { border-color: var(--text-primary); }
.modal-prev { left: 24px; }
.modal-next { right: 24px; }
.modal-close { position: absolute; top: 24px; right: 24px; background: transparent; color: var(--text-primary); width: 40px; height: 40px; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; z-index: 1010;}
.modal-img { max-width: 90%; max-height: 75vh; border-radius: var(--radius-md); border: none; touch-action: none;}
.modal-caption { color: var(--text-primary); font-weight: 500; font-size: 16px; margin-top: 16px; text-align: center; }
.modal-exif { color: var(--text-secondary); font-size: 12px; margin-top: 8px; font-family: monospace; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; text-align: center;}

/* EDITORIAL MARKDOWN STYLES */
.page-container { max-width: 800px; margin: 48px auto; width: 100%; padding-bottom: 64px;}
.markdown-body { font-size: 16px; line-height: 1.8; color: var(--text-primary); }
.markdown-body h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; margin: 48px 0 16px 0; border: none; padding: 0; }
.markdown-body h2:first-child { margin-top: 0; }
.markdown-body h3 { font-size: 18px; font-weight: 600; margin: 32px 0 12px 0; }
.markdown-body p { margin-bottom: 24px; }
.markdown-body ul { margin-left: 24px; margin-bottom: 24px; list-style-type: disc; }
.markdown-body li { margin-bottom: 8px; }
.markdown-body strong { font-weight: 700; color: var(--text-primary); }
.page-content { background: transparent; padding: 0; border: none; }

/* MOBILE RESPONSIVENESS */
@media (max-width: 900px) {
    .mobile-menu-toggle { display: block; }
    .header-actions { display: none; width: 100%; flex-direction: column; align-items: stretch; margin: 16px 0 0 0; gap: 16px; }
    .header-actions.active { display: flex; animation: slideDown 0.3s ease; }
    .nav-links { flex-direction: column; width: 100%; gap: 8px; }
    .nav-links a { width: 100%; }
    .search-wrapper { width: 100%; max-width: 100%; }
    .header-divider { display: none; }

    .header-wrapper { padding: 16px 0; margin-bottom: 24px; }
    .header { padding: 16px; border-radius: var(--radius-lg); }

    .panel-grid { grid-template-columns: 1fr; gap: 48px; }
    .panel-grid::after { display: none; } 
    .responsive-form-grid { grid-template-columns: 1fr; gap: 16px; }
    .responsive-grid-2 { grid-template-columns: 1fr; gap: 16px; }
    .photo-masonry { column-count: 2; }
    
    .hero h1 { font-size: 36px; }
    
    .session-header-minimal { flex-direction: column; text-align: center; padding: 0 0 24px 0; gap: 16px;}
    .session-thumbnail { margin: 0 auto; width: 100px; height: 100px;}
    .session-info h1 { font-size: 28px; }
    .session-meta-row { justify-content: center; gap: 16px; }
    .color-pills-minimal { justify-content: center; }
    .session-controls { flex-direction: column; align-items: stretch; gap: 16px; }
    .session-controls select { width: 100% !important; }
    
    .gallery-detail-hero { grid-template-columns: 1fr; }
    
    .modal-nav { display: none; }
    .modal-img { max-width: 95%; max-height: 60vh; }
    
    .site-footer { bottom: 16px; }
    .footer-inner { flex-direction: row; gap: 12px; padding: 10px 20px; border-radius: var(--radius-pill); }
    .footer-links { gap: 12px; }
}

@media (max-width: 600px) {
    .photo-masonry { column-count: 1; }
    .session-grid { grid-template-columns: 1fr; }
    .card-img-wrap { height: 220px; }
    .file-drop-area { padding: 32px 16px; }
    #preview-grid { grid-template-columns: repeat(3, 1fr); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === NEW EMPTY STATES === */
.empty-state { padding: 64px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; filter: grayscale(1); }
.empty-state-text { font-size: 16px; color: var(--text-secondary); font-weight: 500; }