/* ==========================================================================
   Wedding Photo Sharing — Elise & Olivier
   Thème sage green / olive — inspiré du menu
   ========================================================================== */

:root {
    --bg: #faf9f6;
    --bg-warm: #f2f0eb;
    --text: #3b3f35;
    --text-muted: #7a7e70;
    --sage: #8f9e82;
    --sage-dark: #6e7d62;
    --sage-deeper: #5a6950;
    --sage-light: #c5d0ba;
    --sage-pale: #e4ead9;
    --cream: #f5f3ee;
    --white: #ffffff;
    --danger: #b05a5a;
    --danger-hover: #944848;
    --shadow-sm: 0 1px 3px rgba(59, 63, 53, 0.06);
    --shadow-md: 0 4px 20px rgba(59, 63, 53, 0.08);
    --shadow-lg: 0 8px 40px rgba(59, 63, 53, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-body: 'Outfit', -apple-system, sans-serif;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Nav -------------------------------------------------------------- */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--white);
    border-bottom: 1px solid var(--sage-pale);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.9);
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    font-style: italic;
    color: var(--sage-dark);
    text-decoration: none;
    letter-spacing: 0.03em;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color var(--transition);
}

.nav-links a:hover { color: var(--sage-dark); }

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 1rem;
    background: var(--sage);
    color: var(--white) !important;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 400;
    text-decoration: none;
    transition: all var(--transition);
    border: none;
    cursor: pointer;
}

.btn-sm:hover { background: var(--sage-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-muted) !important; border: 1px solid var(--sage-pale); }
.btn-ghost:hover { background: var(--sage-pale); color: var(--text) !important; }

/* ---- Hero / Upload ---------------------------------------------------- */
.hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
    position: relative;
}

.hero::before {
    content: '\2014\2002\2726\2002\2014';
    display: block;
    color: var(--sage-light);
    font-size: 0.85rem;
    letter-spacing: 0.6em;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.03em;
    color: var(--sage-dark);
    margin-bottom: 0.3rem;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
}

.upload-zone {
    max-width: 500px;
    margin: 0 auto;
    padding: 3rem 2rem;
    border: 1.5px dashed var(--sage-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--white);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--sage);
    background: rgba(143, 158, 130, 0.04);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(143, 158, 130, 0.08);
}

.upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.upload-text { font-size: 1.05rem; color: var(--text); font-weight: 400; }
.upload-hint { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }

.upload-progress {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.progress-bar {
    height: 5px;
    background: var(--sage-pale);
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.progress-fill {
    height: 100%;
    background: var(--sage);
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 0%;
}

#upload-status {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* ---- Stats ------------------------------------------------------------ */
.stats {
    text-align: center;
    padding: 1rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dot { margin: 0 0.4rem; opacity: 0.5; }

/* ---- Gallery Grid ----------------------------------------------------- */
.gallery { padding: 1rem 2rem 4rem; max-width: 1400px; margin: 0 auto; }

.grid {
    display: columns;
    columns: 3;
    column-gap: 1rem;
}

@media (max-width: 900px) { .grid { columns: 2; } }
@media (max-width: 500px) { .grid { columns: 2; column-gap: 0.5rem; } }

.grid-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

.media-card {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    background: var(--sage-pale);
}

.media-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.media-card img,
.media-card video {
    display: block;
    width: 100%;
    height: auto;
}

.play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(59, 63, 53, 0.45);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.15rem;
    font-style: italic;
    font-family: var(--font-display);
}

/* ---- Lightbox --------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(45, 50, 38, 0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.lightbox.hidden { display: none; }

.lb-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.lb-content video {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: var(--radius-sm);
}

.lb-close,
.lb-prev,
.lb-next {
    position: fixed;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color var(--transition);
    z-index: 1001;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover { color: white; }

.lb-close {
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2.5rem;
    line-height: 1;
}

.lb-prev,
.lb-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    padding: 1rem;
}

.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }

.lb-footer {
    margin-top: 1.5rem;
}

.lb-footer .btn-sm {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.lb-footer .btn-sm:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ---- Login Form ------------------------------------------------------- */
.login-form {
    max-width: 340px;
    margin: 2rem auto 0;
}

.login-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-form input[type="password"] {
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--sage-pale);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--white);
    text-align: center;
    outline: none;
    transition: border-color var(--transition);
}

.login-form input:focus { border-color: var(--sage); }

.btn {
    padding: 0.8rem 2rem;
    background: var(--sage);
    color: var(--white);
    border: none;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:hover { background: var(--sage-dark); }

.error {
    color: var(--danger);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* ---- Admin Panel ------------------------------------------------------ */
.admin-header {
    text-align: center;
    padding: 3rem 2rem 1rem;
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    color: var(--sage-dark);
}

.admin-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

.admin-panel {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sage-pale);
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.select-all-label input[type="checkbox"] {
    accent-color: var(--sage);
}

.btn-danger {
    background: var(--danger);
}
.btn-danger:hover {
    background: var(--danger-hover);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.admin-card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sage-pale);
    transition: box-shadow var(--transition);
}

.admin-card:hover { box-shadow: var(--shadow-md); }

.admin-select {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    cursor: pointer;
}

.admin-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--sage);
}

.admin-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.play-badge-sm {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(59, 63, 53, 0.45);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    pointer-events: none;
}

.admin-meta {
    padding: 0.5rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-filename {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-size,
.admin-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.admin-delete-single {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
}

.btn-icon {
    background: rgba(59, 63, 53, 0.35);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    transition: background var(--transition);
    backdrop-filter: blur(4px);
}

.btn-icon:hover { background: rgba(176, 90, 90, 0.75); }

/* ---- Footer ----------------------------------------------------------- */
footer {
    text-align: center;
    padding: 2.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-top: 1px solid var(--sage-pale);
    font-family: var(--font-display);
    font-style: italic;
    letter-spacing: 0.02em;
}

footer::before {
    content: '\2014\2002\2726\2002\2014';
    display: block;
    color: var(--sage-light);
    font-size: 0.75rem;
    letter-spacing: 0.6em;
    margin-bottom: 0.8rem;
    font-style: normal;
}

/* ---- Utilities -------------------------------------------------------- */
.hidden { display: none !important; }

/* ---- Mobile fixes ----------------------------------------------------- */
@media (max-width: 600px) {
    .nav { padding: 0.8rem 1rem; }
    .nav-brand { font-size: 1.2rem; }
    .nav-links { gap: 0.5rem; }
    .nav-links > a:first-child { display: none; }
    .hero { padding: 2.5rem 1rem 2rem; }
    .hero h1 { font-size: 2rem; }
    .hero::before { margin-bottom: 1rem; }
    .gallery { padding: 0.5rem 0.5rem 3rem; }
    .upload-zone { padding: 2rem 1.5rem; }
    .admin-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .lb-prev, .lb-next { font-size: 2rem; }
}
