
/* ================================================
   DESIGN SYSTÈME — PALETTE FAIRE-PART
   ================================================ */
:root {
    /* ---- Palette faire-part ---- */
    --coral:        #DF614A;   /* accent principal */
    --coral-dark:   #BF4A34;   /* hover / pressed  */
    --teal:         #0B484C;   /* texte, foncé     */
    --teal-light:   #1A6B71;   /* teal intermédiaire */
    --yellow:       #FEDC7B;   /* accent chaud     */
    --olive:        #6F8240;   /* vert naturel     */
    --peach:        #F39069;   /* saumon doux      */
    --ivory:        #FFF;   /* fond ivoire      */

    /* ---- Système ---- */
    --pin-red:      var(--coral);
    --pin-red-dark: var(--coral-dark);
    --bg:           var(--ivory);
    --surface:      #ffffff;
    --text-main:    var(--teal);
    --text-muted:   #5A7B7C;
    --border:       #E2D9CC;
    --radius-card:  16px;
    --radius-btn:   24px;
    --shadow-card:  0 1px 8px rgba(11,72,76,.1), 0 4px 16px rgba(11,72,76,.07);
    --shadow-hover: 0 6px 24px rgba(11,72,76,.18);
    --transition:   .2s ease;

    /* Compatibilité anciens noms */
    --bg-color:       var(--bg);
    --primary-blue:   var(--pin-red);
    --border-color:   var(--border);
    --text-secondary: var(--text-muted);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ================================================
   NAVBAR
   ================================================ */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    height: 60px;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--pin-red);
    text-decoration: none;
    letter-spacing: -1px;
    margin-right: 8px;
}
.nav-logo svg { width: 32px; height: 32px; vertical-align: middle; }

.nav-spacer { flex: 1; }

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    transition: background var(--transition);
}
.nav-link:hover { background: var(--bg); }

.nav-link.active, .nav-link--red {
    background: var(--pin-red);
    color: #fff;
}
.nav-link.active:hover, .nav-link--red:hover { background: var(--pin-red-dark); }

/* ================================================
   LAYOUT
   ================================================ */
.gallery-container {
    padding: 24px 20px 60px;
    max-width: 1800px;
    margin: 0 auto;
}

.main-content { padding-top: 24px; }

/* ================================================
   HERO BANNER (page d'accueil non connecté)
   ================================================ */
.hero-banner {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-card);
    max-width: 560px;
    margin: 60px auto;
}
.hero-banner h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}
.hero-banner p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 15px;
}

/* ================================================
   BOUTONS
   ================================================ */
.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: var(--pin-red);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--pin-red-dark); transform: scale(1.03); }

.btn-secondary {
    display: inline-block;
    padding: 10px 22px;
    background: var(--bg);
    color: var(--text-main);
    border: 2px solid var(--border);
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
}
.btn-secondary:hover { background: #e8e8e8; }

.btn-danger {
    display: inline-block;
    padding: 8px 16px;
    background: #d93025;
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-danger:hover { background: #b52419; }

/* ================================================
   CARDS ÉVÉNEMENTS (grille d'accueil)
   ================================================ */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.event-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
}
.event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.event-card__cover {
    height: 190px;
    background-size: cover;
    background-position: center;
    background-color: #f1f1f1;
    position: relative;
}
.event-card__cover-placeholder {
    height: 190px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.event-card__body {
    padding: 16px 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.event-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}
.event-card__cta {
    font-size: 13px;
    color: var(--pin-red);
    font-weight: 600;
    margin-top: auto;
}

/* ================================================
   MASONRY GRILLE PHOTOS
   ================================================ */
.date-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin: 28px 0 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Conteneur masonry */
.photo-grid {
    column-count: 5;
    column-gap: 10px;
    width: 100%;
    margin-top: 16px;
    /* Empêche les artefacts au chargement */
    orphans: 1;
    widows: 1;
}
@media (max-width: 1600px) { .photo-grid { column-count: 4; } }
@media (max-width: 1100px) { .photo-grid { column-count: 3; } }
@media (max-width: 700px)  { .photo-grid { column-count: 2; column-gap: 6px; } }
@media (max-width: 420px)  { .photo-grid { column-count: 2; column-gap: 4px; } }

/* Séparateur de date — traverse toutes les colonnes */
.date-separator {
    column-span: all;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 36px 0 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    user-select: none;
}
.date-separator::before,
.date-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.date-separator::before { flex: 0 0 16px; }

/* ---- Carte photo ---- */
.photo-item {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-bottom: 10px;
    position: relative;
    display: inline-block; /* requis pour column layout */
    width: 100%;
    border-radius: var(--radius-card);
    overflow: hidden;
    cursor: zoom-in;
    /* Animation d'apparition */
    animation: pin-fade-in .35s ease both;
}
@media (max-width: 700px) {
    .photo-item { margin-bottom: 6px; border-radius: 10px; }
}

@keyframes pin-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Image */
.photo-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-card);
    transition: transform .4s cubic-bezier(.25,.46,.45,.94);
    will-change: transform;
    background: #e8e8e8; /* placeholder pendant le chargement */
}
@media (max-width: 700px) { .photo-item img { border-radius: 10px; } }

/* Fond de chargement animé */
.photo-item img:not([src]),
.photo-item img[src=""] {
    min-height: 140px;
    background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hover : zoom discret */
.photo-item:hover img { transform: scale(1.04); }

/* ---- Overlay au hover ---- */
/* Gradient Pinterest : transparent en haut, noir en bas */
.photo-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.0)  0%,
        rgba(0,0,0,.0)  40%,
        rgba(0,0,0,.55) 100%
    );
    border-radius: var(--radius-card);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    z-index: 1;
}
/* Demi-teinte légère en haut pour les boutons d'action */
.photo-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: linear-gradient(to bottom, rgba(0,0,0,.38), transparent);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    z-index: 1;
}
.photo-item:hover::before,
.photo-item:hover::after { opacity: 1; }

/* ---- Actions flottantes ---- */
.photo-item .cover-btn-form,
.photo-item .delete-btn-form {
    position: absolute;
    z-index: 20;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    transform: translateY(-4px);
}
.photo-item:hover .cover-btn-form,
.photo-item:hover .delete-btn-form {
    opacity: 1;
    transform: translateY(0);
}

/* Étoile (couverture) — haut gauche */
.cover-btn-form  { top: 10px; left: 10px; }
/* Suppression — haut droit */
.delete-btn-form { top: 10px; right: 10px; }

.cover-btn-form button,
.delete-btn {
    background: rgba(0,0,0,.52);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 15px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background .18s, transform .18s;
    line-height: 1;
}
.cover-btn-form button:hover {
    background: rgba(251,188,4,.85);
    color: #111;
    transform: scale(1.15);
}
.delete-btn:hover {
    background: var(--pin-red);
    transform: scale(1.15);
}
/* Étoile active = dorée */
.cover-btn-form.is-cover button {
    color: #FBBC04;
    background: rgba(0,0,0,.65);
}

/* ---- Checkbox de sélection ---- */
.photo-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px; height: 22px;
    z-index: 22;
    cursor: pointer;
    accent-color: var(--pin-red);
    opacity: 0;
    transition: opacity .18s;
    border-radius: 50%;
}
/* Visible au hover OU si cochée */
.photo-item:hover .photo-checkbox,
.photo-checkbox:checked { opacity: 1; }

/* Quand une case est cochée : surbrillance de la carte */
.photo-item:has(.photo-checkbox:checked) {
    outline: 3px solid var(--pin-red);
    outline-offset: 0;
}
.photo-item:has(.photo-checkbox:checked) img { transform: scale(1.02); }
.photo-item:has(.photo-checkbox:checked)::before { opacity: .45; }

/* ================================================
   FILTRES / TAGS
   ================================================ */
#filter-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 4px 0;
}

.filter-btn {
    padding: 7px 16px;
    border-radius: var(--radius-btn);
    border: 2px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
    color: var(--text-muted);
}
.filter-btn:hover { border-color: var(--text-main); color: var(--text-main); }
.filter-btn.active {
    background: var(--text-main);
    border-color: var(--text-main);
    color: #fff;
}

/* ================================================
   UPLOAD FAB + MODAL
   ================================================ */
.fab-upload {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--pin-red);
    color: #fff;
    border: none;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(230,0,35,.45);
    z-index: 150;
    transition: background var(--transition), transform var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.fab-upload:hover { background: var(--pin-red-dark); transform: scale(1.1); }

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 300;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.modal-overlay.open, .modal-overlay.active { display: flex; }

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-card);
    padding: 32px;
    width: 90%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
}

.close-modal {
    position: absolute;
    top: 14px; right: 18px;
    font-size: 26px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.close-modal:hover { color: var(--text-main); }

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    color: var(--text-muted);
    font-size: 15px;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--pin-red);
    background: #fff5f5;
    color: var(--pin-red);
}

/* ================================================
   BATCH BAR (sélection)
   ================================================ */
.batch-bar {
    display: none;
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-btn);
    gap: 14px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    z-index: 140;
}

.batch-btn {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}
.batch-download { background: var(--pin-red); color: #fff; }
.batch-download:hover { background: var(--pin-red-dark); }

/* ================================================
   VIEWER (visionneuse sociale)
   ================================================ */
.viewer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    z-index: 400;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}
.viewer-overlay.open, .viewer-overlay.active { display: flex; }

.viewer-container {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-card);
    overflow: hidden;
    max-width: 1100px;
    width: 95vw;
    max-height: 92vh;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}

.viewer-image-side {
    flex: 1;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-width: 0;
    overflow: hidden;
}
.viewer-image-side img {
    max-width: 100%;
    max-height: 92vh;
    object-fit: contain;
    display: block;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px; height: 44px;
    font-size: 20px;
    cursor: pointer;
    transition: background .2s;
    backdrop-filter: blur(4px);
}
.nav-btn:hover { background: rgba(255,255,255,.35); }
#prev-photo { left: 12px; }
#next-photo { right: 12px; }

.viewer-sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    overflow: hidden;
}
.viewer-header {
    padding: 16px 18px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.global-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.global-close:hover { color: var(--pin-red); }

.viewer-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.viewer-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.viewer-input-area input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    font-size: 13px;
    outline: none;
}
.viewer-input-area input:focus { border-color: var(--pin-red); }
.viewer-input-area button {
    padding: 9px 16px;
    background: var(--pin-red);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
}
.viewer-input-area button:hover { background: var(--pin-red-dark); }

/* ================================================
   MESSAGES / ALERTS
   ================================================ */
.msg {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
}
.msg-success { background: #EEF3E6; color: var(--olive); border-left: 4px solid var(--olive); }
.msg-error   { background: #FAE9E6; color: var(--coral-dark); border-left: 4px solid var(--coral); }

/* ================================================
   AUTH PAGES (login / register)
   ================================================ */
.auth-wrapper {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF5E6 0%, var(--ivory) 55%, #F0F5E8 100%);
    padding: 40px 16px;
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.auth-logo {
    font-size: 36px;
    font-weight: 800;
    color: var(--pin-red);
    letter-spacing: -2px;
    margin-bottom: 4px;
}
.auth-card h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 8px 0 4px;
}
.auth-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}
.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color .2s;
    outline: none;
    background: var(--bg);
}
.auth-form input:focus { border-color: var(--pin-red); background: #fff; }
.auth-form .btn-primary { margin-top: 6px; text-align: center; width: 100%; }

.auth-footer {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.auth-footer a { color: var(--pin-red); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.auth-error {
    background: #FAE9E6;
    color: var(--coral-dark);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    text-align: left;
    border-left: 3px solid var(--coral);
}

/* ================================================
   ADMIN
   ================================================ */
.admin-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.admin-container h1 {
    font-size: 26px;
    font-weight: 800;
}

.admin-card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 28px 28px;
}
.admin-card h2 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}
.admin-form input,
.admin-form select,
.admin-form textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg);
    outline: none;
    flex: 1;
    min-width: 180px;
    transition: border-color .2s;
}
.admin-form input:focus,
.admin-form select:focus { border-color: var(--pin-red); background: #fff; }

.admin-form button,
.admin-form .btn-primary {
    padding: 10px 22px;
    background: var(--pin-red);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
.admin-form button:hover { background: var(--pin-red-dark); }

.event-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.event-item strong { font-size: 15px; }
.event-item small { color: var(--text-muted); font-size: 12px; }

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    color: #fff;
    margin-left: 6px;
    vertical-align: middle;
}
.badge-admin   { background: var(--coral); }
.badge-user    { background: var(--peach); color: #fff; }
.badge-open    { background: var(--olive); }
.badge-private { background: var(--teal); }
.badge-password{ background: var(--yellow); color: var(--teal); }

.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.inline-form select,
.inline-form input {
    padding: 5px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    background: var(--surface);
    outline: none;
}
.btn-sm {
    padding: 5px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: var(--text-muted);
    color: #fff;
}
.btn-sm:hover { background: var(--text-main); }
.btn-sm-red { background: var(--coral); }
.btn-sm-red:hover { background: var(--coral-dark); }
.btn-sm-yellow { background: var(--yellow); color: var(--teal); }

.success-msg {
    background: #EEF3E6;
    color: var(--olive);
    border-left: 4px solid var(--olive);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* ================================================
   INVITE LINK BOX
   ================================================ */
.invite-box {
    margin-top: 16px;
    padding: 16px 18px;
    background: #EEF3E6;
    border: 1px solid var(--olive);
    border-radius: 12px;
}
.invite-box p { margin: 0 0 10px; color: var(--olive); font-weight: 600; font-size: 14px; }
.invite-box input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
}
.btn-copy {
    padding: 8px 18px;
    background: var(--olive);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn-copy:hover { background: #5A6B34; }

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-card);
    margin-top: 20px;
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 14px; }

/* ================================================
   SCROLL SENTINEL
   ================================================ */
#scroll-sentinel {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 20px;
}

/* ================================================
   PASSWORD PAGE
   ================================================ */
.password-page { /* identique auth-wrapper */ }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 600px) {
    .gallery-container { padding: 12px 10px 60px; }
    .auth-card { padding: 32px 20px; }
    .admin-container { padding: 16px 10px 60px; }
    .viewer-sidebar { display: none; }
    .viewer-container { border-radius: 0; }
    .batch-bar { width: 90%; }
}


/* --- VISIONNEUSE (LIGHTBOX) --- */
.lightbox {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Boutons de la visionneuse */
.lightbox-btn {
    position: absolute;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 20px;
    transition: transform 0.2s;
}

.lightbox-btn:hover {
    transform: scale(1.1);
}

.lightbox-close { top: 20px; right: 30px; font-size: 40px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.event-header { margin-bottom: 30px; text-align: center; }
        .upload-box { background: white; border: 1px dashed var(--primary-blue); padding: 20px; border-radius: 8px; text-align: center; margin-bottom: 30px; }
        .msg { padding: 10px; border-radius: 4px; margin-bottom: 20px; text-align: center; }
        .msg-success { background: #e6f4ea; color: #137333; }
        .msg-error { background: #fce8e6; color: #c5221f; }
        /* Style du bouton de suppression */
        /* --- STYLE DES CONTRÔLES SUR LES PHOTOS --- */
        .photo-item { 
            position: relative; 
            overflow: hidden; /* Assure que les éléments ne dépassent pas */
        }
        
        /* 1. La case à cocher */
        .photo-checkbox {
            position: absolute; 
            top: 10px; 
            left: 10px; 
            z-index: 10;
            width: 22px; 
            height: 22px; 
            cursor: pointer;
            opacity: 0; /* Totalement cachée par défaut */
            transition: opacity 0.2s ease;
            accent-color: var(--primary-blue);
        }

        /* 2. Le bouton de suppression (Croix) */
        .delete-btn-form {
            position: absolute;
            top: 8px;
            right: 8px;
            z-index: 10;
            opacity: 0; /* Totalement cachée par défaut */
            transition: opacity 0.2s ease;
        }

        /* --- LE COMPORTEMENT D'AFFICHAGE --- */
        
        /* Au survol de la photo, on affiche tout */
        .photo-item:hover .photo-checkbox,
        .photo-item:hover .delete-btn-form { 
            opacity: 1; 
        }

        /* MAGIE : L'astuce pour garder la case visible si elle est cochée.
           En CSS, on cible l'état :checked */
        .photo-checkbox:checked { 
            opacity: 1; 
        }
        .delete-btn {
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s;
        }
        .delete-btn:hover {
            background-color: #d93025; /* Rouge Google */
        }
        /* Style des cases à cocher sur les photos */
        
        .photo-checkbox:checked, .photo-item:hover .photo-checkbox { opacity: 1; }

        /* La barre flottante (cachée par défaut) */
        .batch-bar {
            display: none; position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
            background: white; padding: 15px 30px; border-radius: 50px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.3); z-index: 1000;
            align-items: center; gap: 15px; border: 1px solid var(--border-color);
        }
        .batch-btn { padding: 10px 20px; border: none; border-radius: 20px; cursor: pointer; font-weight: 500; font-size: 14px;}
        .batch-download { background: var(--primary-blue); color: white; }
        .batch-delete { background: #d93025; color: white; }
        /* Le bouton de couverture (Étoile) */
        .cover-btn-form {
            position: absolute; top: 8px; right: 40px; /* Décalé à gauche de la croix */
            z-index: 10; opacity: 0; transition: opacity 0.2s ease;
        }
        .photo-item:hover .cover-btn-form { opacity: 1; }
        
        /* Garder l'étoile visible si c'est la couverture actuelle */
        .cover-btn-form.is-cover { opacity: 1 !important; }
        
        /* Bouton d'ajout flottant (+) */
        .fab-upload {
            position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
            background: var(--primary-blue); color: white; border-radius: 50%;
            font-size: 32px; font-weight: bold; border: none; cursor: pointer;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 1000;
            display: flex; align-items: center; justify-content: center; transition: transform 0.2s;
        }
        .fab-upload:hover { transform: scale(1.1); }

        /* La Fenêtre Popup (Modal) */
        .modal-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
            z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
        }
        .modal-overlay.active { opacity: 1; pointer-events: auto; }
        .modal-content {
            background: white; padding: 30px; border-radius: 12px; width: 90%; max-width: 500px;
            position: relative; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        }
        .close-modal {
            position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: #555;
        }
        .upload-area {
            border: 2px dashed var(--primary-blue); padding: 50px 20px; margin-top: 20px;
            border-radius: 8px; cursor: pointer; background: #f8faff; color: var(--primary-blue);
            font-weight: 500; transition: background 0.2s;
        }
        .upload-area:hover { background: #e8f0fe; }
        /* Style du bouton Partager */
        .share-btn {
            background: #f1f3f4; 
            color: var(--text-main); 
            border: none; 
            padding: 8px 16px;
            border-radius: 20px; 
            cursor: pointer; 
            font-size: 14px; 
            font-weight: 500;
            transition: all 0.2s ease; 
            display: flex; 
            align-items: center; 
            gap: 6px;
        }
        .share-btn:hover { background: #e8eaed; }
        
        /* Style quand le lien est copié avec succès */
        .share-btn.copied { 
            background: #e6f4ea; 
            color: #137333; 
        }
        /* La nouvelle visionneuse */
        .viewer-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.9); z-index: 3000;
            display: none; /* Caché par défaut */
            align-items: center; justify-content: center;
        }
        .viewer-overlay.active { display: flex; }
        
        .viewer-container {
            display: flex; width: 85%; max-width: 1200px; height: 90vh;
            background: var(--card-bg, #fff); border-radius: 12px; overflow: hidden;
            box-shadow: 0 10px 40px rgba(0,0,0,0.5);
        }
        
        .viewer-image-side {
            flex: 1; background: #000; display: flex; align-items: center; justify-content: center;
            position: relative;
        }
        .viewer-image-side img { max-width: 100%; max-height: 100%; object-fit: contain; }
        
        .viewer-sidebar {
            width: 350px; display: flex; flex-direction: column; background: var(--bg-color, #fff);
            border-left: 1px solid var(--border-color, #eee);
        }
        
        .viewer-header { padding: 15px; border-bottom: 1px solid var(--border-color, #eee); font-weight: bold; }
        
        .viewer-comments-list {
            flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 15px;
        }
        .comment-item { font-size: 14px; }
        .comment-author { font-weight: bold; color: var(--text-main); margin-right: 5px; }
        .comment-date { font-size: 11px; color: var(--text-muted); display: block; margin-top: 3px; }
        
        .viewer-input-area {
            padding: 15px; border-top: 1px solid var(--border-color, #eee); display: flex; gap: 10px;
        }
        .viewer-input-area input {
            flex: 1; padding: 10px; border: 1px solid var(--border-color); border-radius: 20px;
            background: var(--bg-color); color: var(--text-main);
        }
        .viewer-input-area button {
            background: var(--primary-blue, #1a73e8); color: white; border: none;
            padding: 8px 15px; border-radius: 20px; cursor: pointer; font-weight: bold;
        }
        .viewer-close {
            position: absolute; top: -40px; right: 0; color: white; font-size: 35px; cursor: pointer;
        }

        /* Mobile responsive */
        @media (max-width: 800px) {
            .viewer-container { flex-direction: column; }
            .viewer-sidebar { width: 100%; height: 40%; }
            .viewer-image-side { height: 60%; }
        }

        /* Bouton fermer global */
        .global-close {
            color: grey;
            position: absolute; top: 20px; right: 30px; color: white;
            font-size: 50px; cursor: pointer; z-index: 3100;
            line-height: 1; transition: transform 0.2s;
        }
        .global-close:hover { transform: scale(1.1); }

        /* Flèches de navigation */
        .nav-btn {
            position: absolute; top: 50%; transform: translateY(-50%);
            background: rgba(0,0,0,0.6); color: white; border: none;
            font-size: 24px; width: 50px; height: 50px; border-radius: 50%;
            cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center;
            transition: background 0.2s;
        }
        .nav-btn:hover { background: rgba(0,0,0,0.9); }
        .nav-btn:disabled { background: rgba(0,0,0,0.2); cursor: not-allowed; color: #888; }
        
        #prev-photo { left: 15px; }
        #next-photo { right: 15px; }

        /* Ajustements de la visionneuse pour mobile */
        @media (max-width: 800px) {
            .nav-btn {
                width: 60px; height: 60px; /* Plus gros pour les doigts */
                background: rgba(0,0,0,0.3); /* Un peu plus transparent */
            }
            #prev-photo { left: 5px; }
            #next-photo { right: 5px; }
            
            /* On descend un peu le bouton fermer pour ne pas toucher l'heure/batterie du téléphone */
            .global-close { top: 10px; right: 15px; font-size: 40px; }
        }
        /* Style des filtres et tags */
        .filter-btn {
            padding: 8px 16px; border-radius: 20px; border: 1px solid var(--primary-blue);
            background: transparent; color: var(--primary-blue); cursor: pointer; transition: 0.2s; font-weight: bold;
        }
        .filter-btn.active, .filter-btn:hover { background: var(--primary-blue); color: white; }
        .tag-badge { background: #e8f0fe; color: var(--primary-blue); padding: 4px 10px; border-radius: 12px; font-size: 12px; }

        .hero-banner { text-align: center; padding: 60px 20px; background-color: #f8f9fa; border-radius: 8px; margin-bottom: 40px; }
        .hero-banner h2 { font-size: 28px; margin-bottom: 15px; color: var(--text-main); }
        .btn-primary { display: inline-block; padding: 12px 24px; background-color: var(--primary-blue); color: white; text-decoration: none; border-radius: 4px; font-weight: 500; }
        .event-card { display: block; text-decoration: none; color: inherit; background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; transition: box-shadow 0.2s; }
        .event-card:hover { box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
        .event-card h3 { color: var(--primary-blue); margin-bottom: 10px; }

        .admin-container { max-width: 800px; margin: 40px auto; padding: 0 20px; }
        .admin-card { background: white; border: 1px solid var(--border-color); border-radius: 8px; padding: 24px; margin-bottom: 24px; }
        .admin-card h2 { margin-bottom: 16px; font-size: 18px; color: var(--text-main); }
        .admin-form { display: flex; gap: 10px; flex-wrap: wrap; }
        .admin-form input, .admin-form select { flex: 1; min-width: 200px; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; }
        .admin-form button { padding: 10px 20px; background: var(--primary-blue); color: white; border: none; border-radius: 4px; cursor: pointer; }
        .event-list { list-style: none; }
        .event-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
        .success-msg { background: #e6f4ea; color: #137333; padding: 10px; border-radius: 4px; margin-bottom: 20px; }