:root {
  --primary: #1565C0;
  --primary-dark: #0D47A1;
  --primary-light: #e3f2fd;
  --accent: #D4A843;
  --sidebar-w: 260px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #f5f7fa; overflow-x: hidden; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: var(--sidebar-w); background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white; z-index: 1000; display: flex; flex-direction: column;
  transition: transform 0.3s ease;
}
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.15); }
.sidebar-logo { width: 50px; height: 50px; border-radius: 50%; margin-bottom: 8px; border: 2px solid rgba(255,255,255,0.3); }
.sidebar-nav { list-style: none; flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: rgba(255,255,255,0.8); text-decoration: none;
  font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
  background: rgba(255,255,255,0.1); color: white; border-left-color: var(--accent);
}
.sidebar-nav li a i { font-size: 18px; width: 22px; text-align: center; }
.nav-section {
  padding: 15px 20px 5px; font-size: 11px; text-transform: uppercase;
  color: rgba(255,255,255,0.4); letter-spacing: 1px; font-weight: 700;
}
.sidebar-footer { padding: 15px; border-top: 1px solid rgba(255,255,255,0.15); }
.user-info { font-size: 13px; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

/* ===== MAIN CONTENT ===== */
.main-content { margin-right: var(--sidebar-w); min-height: 100vh; }
.page-container { padding: 24px; }

/* ===== TOP HEADER ===== */
.top-header {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.header-logo-wrap {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}

.header-logo { width: 56px; height: 56px; border-radius: 50%; }

.header-title {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.header-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 0.75rem;
}

.header-subtitle-bar {
  font-size: 0.72rem;
  font-weight: 600;
  color: #c0392b;
  letter-spacing: 0.02em;
  background: #f5f7fa;
  padding: 2px 16px 2px 84px;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px; height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 100%; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* Sticky hamburger flottant (apparaît au scroll) */
.sticky-hamburger {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.sticky-hamburger.visible {
  opacity: 1;
  pointer-events: auto;
}

.sticky-hamburger .hamburger {
  border: 2px solid var(--primary);
  border-radius: 6px;
  padding: 5px;
  width: 36px;
  height: 30px;
}

.sticky-hamburger .hamburger span {
  background: var(--primary);
}

/* ===== CARDS & STATS ===== */
.stat-card {
  background: white; border-radius: 12px; padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); border-left: 4px solid var(--primary);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-number { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.accent .stat-number { color: var(--accent); }
.stat-card.success { border-left-color: #2e7d32; }
.stat-card.success .stat-number { color: #2e7d32; }
.stat-card.danger { border-left-color: #c62828; }
.stat-card.danger .stat-number { color: #c62828; }

/* ===== DATA TABLE ===== */
.data-card {
  background: white; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden;
}
.data-card-header {
  padding: 16px 20px; border-bottom: 1px solid #eee;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.data-card-header h5 { margin: 0; font-weight: 600; color: #333; }
.data-card-body { padding: 0; }
.table { margin: 0; font-size: 14px; }
.table th { background: #f8f9fa; font-weight: 600; color: #555; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.table td { vertical-align: middle; }
.table .btn-sm { padding: 2px 8px; font-size: 12px; }
.btn-xs { padding: 1px 5px; font-size: 11px; line-height: 1.4; }

/* ===== BADGES ===== */
.role-badge { font-size: 11px; padding: 3px 8px; border-radius: 12px; font-weight: 600; }
.role-adm { background: #c62828; color: white; }
.role-ed { background: #6a1b9a; color: white; }
.role-ad { background: var(--primary); color: white; }
.role-pro { background: #2e7d32; color: white; }
.role-sec { background: #e65100; color: white; }
.role-tre { background: var(--accent); color: white; }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 24px; }
.page-header h4 { font-weight: 700; color: #333; margin-bottom: 4px; }
.page-header p { color: #888; font-size: 14px; margin: 0; }

/* ===== FORMS ===== */
.form-section { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 20px; }
.form-section h5 { font-weight: 600; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-light); }

/* ===== MODAL ===== */
.modal-header { background: var(--primary); color: white; }
.modal-header .btn-close { filter: brightness(0) invert(1); }
@media (max-width: 767.98px) {
  .modal-dialog { margin: 0; max-width: 100%; width: 100%; }
  .modal-content { border-radius: 0; }
}

/* ===== OVERLAY MOBILE ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; }
.sidebar-overlay.show { display: block; }

/* ===== PRESENCE GRID ===== */
.presence-cell { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; font-weight: 700; font-size: 13px; transition: all 0.15s; border: 2px solid #dee2e6; background: #f8f9fa; color: #6c757d; }
.presence-cell.present { background: #c8e6c9; color: #2e7d32; border-color: #a5d6a7; }
.presence-cell.absent { background: #ffcdd2; color: #c62828; border-color: #ef9a9a; }
.presence-cell.excuse { background: #fff9c4; color: #f57f17; border-color: #ffe082; }

/* Cellules présence danse (profs) — boutons larges avec texte */
.presence-cell-danse { display: inline-flex; align-items: center; justify-content: center; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.15s; border: 2px solid #dee2e6; background: #f8f9fa; color: #6c757d; white-space: nowrap; user-select: none; }
.presence-cell-danse:hover { border-color: #adb5bd; background: #e9ecef; }
.presence-cell-danse.present { background: #c8e6c9; color: #1b5e20; border-color: #66bb6a; }
.presence-cell-danse.absent { background: #ffcdd2; color: #b71c1c; border-color: #ef5350; }
.presence-cell-danse.neutre { background: #f8f9fa; color: #adb5bd; border-color: #dee2e6; font-weight: 400; }

/* ===== SCAN & TRADUCTION ===== */
.scan-step { }
.scan-capture-card { background:#fff; border-radius:16px; padding:40px 24px; text-align:center; box-shadow:0 2px 12px rgba(0,0,0,.08); }
.scan-capture-icon { font-size:4rem; color:#1565C0; margin-bottom:16px; }
.scan-preview-card { display:flex; gap:20px; background:#fff; border-radius:16px; padding:20px; box-shadow:0 2px 12px rgba(0,0,0,.08); }
.scan-preview-wrap { flex:0 0 auto; display:flex; flex-direction:column; align-items:center; }
.scan-preview-img { max-width:260px; max-height:340px; width:100%; object-fit:contain; border-radius:10px; border:2px solid #e0e0e0; }
.scan-analyse-wrap { flex:1; display:flex; flex-direction:column; justify-content:center; }
.scan-tamil-text { font-family:'Noto Sans Tamil','Latha','Tamil MN',serif; font-size:1.2rem; line-height:2; white-space:pre-wrap; min-height:80px; }

@media (max-width: 767.98px) {
  .scan-capture-card { padding:24px 16px; }
  .scan-capture-icon { font-size:3rem; }
  .scan-preview-card { flex-direction:column; padding:16px; }
  .scan-preview-img { max-width:100%; max-height:220px; }
  .scan-analyse-wrap { margin-top:12px; }
  .scan-tamil-text { font-size:1.1rem; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .page-container { padding: 16px; }
}

@media (max-width: 767.98px) {
  /* Marges latérales minimales sur mobile (sauf dashboard) */
  .page-container:not([data-page="dashboard"]) { padding: 0 10px; }
  .page-header { padding: 12px 12px 0; margin-bottom: 12px; }
  .page-header h4 { font-size: 17px; }

  /* data-card pleine largeur, pas de bord arrondi */
  .data-card { border-radius: 0; box-shadow: none; border-bottom: 1px solid #e0e0e0; margin-bottom: 0; }
  .data-card-header { padding: 10px 12px; gap: 8px; }

  /* form-section pleine largeur */
  .form-section { border-radius: 0; padding: 12px; margin-bottom: 8px; box-shadow: none; border-bottom: 1px solid #e0e0e0; }

  /* stat-cards */
  .stat-card { border-radius: 8px; padding: 12px 14px; }
  .stat-number { font-size: 22px; }

  /* ==== TABLE MOBILE : chaque ligne devient un bloc liste ==== */
  /* Ajouter class="table-mobile" sur <table> pour activer */
  .table-mobile thead { display: none; }
  .table-mobile tbody tr {
    display: block;
    border-bottom: 1px solid #e8e8e8;
    padding: 8px 12px;
    background: white;
  }
  .table-mobile tbody tr:last-child { border-bottom: none; }
  .table-mobile tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border: none;
    font-size: 13px;
    min-height: 26px;
  }
  .table-mobile tbody td:empty { display: none; }
  .table-mobile tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    margin-right: 8px;
    min-width: 70px;
  }
  /* cellules sans label (photo, actions) : centrées, pas de before */
  .table-mobile tbody td[data-label=""] { justify-content: flex-end; }
  .table-mobile tbody td[data-label=""]::before { display: none; }
  /* ligne principale mise en avant (nom/titre) */
  .table-mobile tbody td.tm-main {
    font-size: 15px; font-weight: 600; color: #222;
    justify-content: flex-start; padding-top: 6px;
  }
  .table-mobile tbody td.tm-main::before { display: none; }
  /* header de ligne : photo + nom côte à côte */
  .table-mobile tbody td.tm-head {
    justify-content: flex-start; gap: 10px; padding: 6px 0;
  }
  .table-mobile tbody td.tm-head::before { display: none; }
  /* Colonnes qui doublonnent avec tm-head : masquées sur mobile */
  .table-mobile tbody td.tm-desktop-only { display: none; }
  /* ligne d'actions en fin de bloc */
  .table-mobile tbody td.tm-actions {
    justify-content: flex-end; padding-top: 6px; padding-bottom: 2px;
  }
  .table-mobile tbody td.tm-actions::before { display: none; }
}

@media (max-width: 575.98px) {
  .stat-card { padding: 12px; }
  .stat-number { font-size: 20px; }
}

/* Sur desktop : tm-head masqué (info déjà dans les colonnes normales) */
.table-mobile td.tm-head { display: none; }

/* ===== DASHBOARD CARDS ===== */
.dash-card {
  background: white; border-radius: 14px; padding: 20px 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07); border-top: 4px solid var(--primary);
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex; flex-direction: column; gap: 10px; min-height: 110px;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.13); }
.dash-card.c-primary  { border-top-color: var(--primary); }
.dash-card.c-accent   { border-top-color: var(--accent); }
.dash-card.c-success  { border-top-color: #2e7d32; }
.dash-card.c-danger   { border-top-color: #c62828; }
.dash-card.c-warning  { border-top-color: #e65100; }
.dash-card.c-info     { border-top-color: #0277bd; }
.dash-card.c-purple   { border-top-color: #6a1b9a; }
.dash-card.c-teal     { border-top-color: #00695c; }
.dash-card-icon { font-size: 26px; line-height: 1; }
.dash-card.c-primary  .dash-card-icon { color: var(--primary); }
.dash-card.c-accent   .dash-card-icon { color: var(--accent); }
.dash-card.c-success  .dash-card-icon { color: #2e7d32; }
.dash-card.c-danger   .dash-card-icon { color: #c62828; }
.dash-card.c-warning  .dash-card-icon { color: #e65100; }
.dash-card.c-info     .dash-card-icon { color: #0277bd; }
.dash-card.c-purple   .dash-card-icon { color: #6a1b9a; }
.dash-card.c-teal     .dash-card-icon { color: #00695c; }
.dash-card-value { font-size: 30px; font-weight: 800; color: #222; line-height: 1; }
.dash-card-label { font-size: 12px; color: #777; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.dash-card-link { font-size: 12px; color: #999; text-decoration: none; cursor: pointer; }
.dash-card-link:hover { color: var(--primary); }
/* section title for dashboard groups */
.dash-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #aaa; margin: 8px 0 4px; }
/* dashboard config toggle (admin) */
.dash-cfg-card { border: 2px solid #eee; border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; background: white; }
.dash-cfg-card.enabled { border-color: var(--primary); background: #f0f4ff; }
.dash-cfg-col.drag-over .dash-cfg-card { border-color: var(--accent); background: #fff8e1; transform: scale(1.03); }
@media (max-width: 767.98px) {
  .dash-card { padding: 14px 12px; min-height: 90px; }
  .dash-card-value { font-size: 24px; }
  .dash-card-icon { font-size: 22px; }
}

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 60px 20px; color: #aaa; }
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }

/* ===== EVENT CARDS (Dashboard) ===== */
.ev-card {
  border-radius: 12px; overflow: hidden;
  background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex; flex-direction: column; height: 100%;
}
.ev-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(21,101,192,0.13); }
.ev-card.ev-past { opacity: 0.75; }
.ev-card.ev-past:hover { opacity: 1; }
.ev-card-img {
  height: 130px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex; align-items: flex-start; padding: 12px; position: relative; flex-shrink: 0;
  overflow: hidden;
}
.ev-card-img img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 0.35s ease;
}
.ev-card:hover .ev-card-img img { transform: scale(1.05); }
.ev-card-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0.05) 60%);
  pointer-events: none;
}
.ev-card-img .ev-date-badge { position: relative; z-index: 1; }
.ev-date-badge {
  display: flex; flex-direction: column; align-items: center;
  padding: 7px 14px; border-radius: 10px; font-weight: 700; line-height: 1.15; min-width: 56px;
}
.ev-date-badge.date-upcoming { background: white; color: var(--primary); }
.ev-date-badge.date-past { background: rgba(255,255,255,0.22); color: white; }
.ev-date-badge .date-day { font-size: 1.5rem; font-weight: 800; }
.ev-date-badge .date-month { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ev-date-badge .date-status { font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; opacity: 0.72; }
.ev-card-body { padding: 14px 16px 16px; flex: 1; }
.ev-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.ev-card-tag {
  font-size: 0.62rem; padding: 2px 9px; border-radius: 20px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(21,101,192,0.1); color: var(--primary);
}
.ev-card-date { font-size: 0.75rem; color: #6c757d; }
.ev-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.ev-card-location {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.8rem; color: var(--primary); margin-bottom: 8px;
  padding: 3px 9px; background: rgba(21,101,192,0.06); border-radius: 6px;
}
.ev-card-excerpt { font-size: 0.83rem; line-height: 1.55; color: #555; margin: 0; }

/* ===== LOADING ===== */
.loading-spinner { display: flex; align-items: center; justify-content: center; padding: 40px; }

/* ===== DOCUMENTS GRID ===== */
.doc-card { transition: transform 0.15s, box-shadow 0.15s; }
.doc-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,0.13) !important; }
@media (max-width: 575.98px) {
  #docsList [style*="grid-template-columns"] { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important; gap: 8px !important; }
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
  background: var(--primary);
  color: #fff;
  padding: 20px 16px;
  text-align: center;
}

.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-name { font-weight: 600; font-size: 0.85rem; color: #fff; margin-bottom: 4px; }
.footer-detail { font-size: 0.78rem; color: rgba(255,255,255,0.7); margin-top: 2px; }

.footer-links {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.footer-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-sep { color: rgba(255,255,255,0.3); margin: 0 8px; font-size: 0.78rem; }

.footer-copy {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  margin-top: 8px;
}

/* ===== ANNIVERSAIRES DASHBOARD ===== */
.bd-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 20px;
  padding: 0;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: relative;
}
.bd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 12px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.bd-header-icon { font-size: 22px; }
.bd-header h5 { color: #fff; margin: 0; font-size: 16px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 8px; }
.bd-badge-today { background: linear-gradient(90deg,#ff6b6b,#ffd93d); color: #1a1a2e; font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 700; }
.bd-music-ctrl { margin-left: auto; }
.bd-btn-music {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 16px; cursor: pointer;
  transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
}
.bd-btn-music:hover { background: rgba(255,255,255,0.22); transform: scale(1.1); }
.bd-btn-music.playing { background: linear-gradient(135deg,#ffd93d,#ff6b6b); animation: bdMusicPulse 1s infinite; }
@keyframes bdMusicPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.bd-slider-wrap { position: relative; overflow: hidden; }
.bd-slider { display: flex; transition: transform 0.5s cubic-bezier(.4,0,.2,1); }

.bd-slide {
  min-width: 100%;
  padding: 24px 28px 20px;
  position: relative;
  overflow: hidden;
}
.bd-slide.bd-today {
  background: linear-gradient(135deg, rgba(255,107,107,0.15) 0%, rgba(255,217,61,0.1) 100%);
}

/* Confetti bar animée */
.bd-confetti-bar {
  display: flex; gap: 8px; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
  animation: bdConfettiScroll 3s linear infinite;
}
@keyframes bdConfettiScroll {
  0%   { letter-spacing: 4px; opacity: 0.7; }
  50%  { letter-spacing: 12px; opacity: 1; }
  100% { letter-spacing: 4px; opacity: 0.7; }
}

.bd-slide-inner { display: flex; align-items: center; gap: 24px; }

.bd-avatar-wrap { position: relative; flex-shrink: 0; }
.bd-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,217,61,0.6);
  box-shadow: 0 0 20px rgba(255,217,61,0.3);
}
.bd-cake-icon {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b6b, #ffd93d);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(255,107,107,0.4);
}
.bd-cake-emoji { font-size: 40px; }
.bd-pulse { animation: bdPulse 2s ease-in-out infinite; }
@keyframes bdPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,217,61,0.4); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(255,217,61,0); }
}
.bd-crown {
  position: absolute; top: -12px; left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  animation: bdCrownFloat 2s ease-in-out infinite;
}
@keyframes bdCrownFloat {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-5px); }
}

.bd-info { flex: 1; }
.bd-day-label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.bd-label-today { color: #ffd93d; }
.bd-label-soon  { color: rgba(255,255,255,0.5); }
.bd-name { color: #fff; font-size: 22px; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
.bd-age { color: rgba(255,255,255,0.6); font-size: 14px; margin-bottom: 8px; }
.bd-wishes {
  display: inline-block;
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 15px; font-weight: 700;
  animation: bdRainbow 3s linear infinite;
}
@keyframes bdRainbow { 0% { background-position: 0% } 100% { background-position: 300% } }
.bd-wishes-soon { color: rgba(255,255,255,0.55); font-size: 13px; }

/* Sparkles flottantes */
.bd-sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bd-sparkles span {
  position: absolute;
  color: #ffd93d;
  font-size: 14px;
  animation: bdSparkle 2.5s ease-in-out infinite;
  opacity: 0;
}
.bd-sparkles span:nth-child(1) { left: 10%;  top: 20%; animation-delay: 0s;    font-size: 10px; }
.bd-sparkles span:nth-child(2) { left: 80%;  top: 15%; animation-delay: 0.6s;  font-size: 16px; }
.bd-sparkles span:nth-child(3) { left: 60%;  top: 70%; animation-delay: 1.2s;  font-size: 12px; }
.bd-sparkles span:nth-child(4) { left: 30%;  top: 80%; animation-delay: 1.8s;  font-size: 8px;  }
@keyframes bdSparkle {
  0%,100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.5) rotate(180deg); }
}

/* Dots + nav */
.bd-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 14px; }
.bd-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}
.bd-dot.active { background: #ffd93d; transform: scale(1.3); }
.bd-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 24px;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 2;
  padding: 0;
}
.bd-nav:hover { background: rgba(255,255,255,0.25); }
.bd-nav-prev { left: 8px; }
.bd-nav-next { right: 8px; }

/* ===== ANNIVERSAIRES — PLEIN ÉCRAN ===== */
.bd-fullscreen-hint {
  color: rgba(255,255,255,0.3);
  font-size: 18px;
  align-self: flex-start;
  margin-left: auto;
  padding: 4px;
  transition: color 0.2s;
}
.bd-slide:hover .bd-fullscreen-hint { color: rgba(255,255,255,0.7); }

.bd-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.bd-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
}
.bd-modal-content {
  position: relative; z-index: 1;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 24px;
  padding: 48px 40px 40px;
  max-width: 480px; width: 90%;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: bdModalIn 0.35s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
@keyframes bdModalIn {
  from { transform: scale(0.8) translateY(30px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.bd-modal-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(255,255,255,0.1);
  border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 14px; cursor: pointer;
  transition: background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.bd-modal-close:hover { background: rgba(255,255,255,0.25); }

.bd-modal-confetti {
  display: flex; gap: 6px; justify-content: center;
  font-size: 20px; margin-bottom: 20px;
  animation: bdConfettiScroll 2.5s linear infinite;
}
.bd-modal-avatar-wrap {
  position: relative; display: inline-block; margin-bottom: 20px;
}
.bd-modal-avatar {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,217,61,0.7);
  box-shadow: 0 0 40px rgba(255,217,61,0.4), 0 0 80px rgba(255,107,107,0.2);
}
.bd-modal-crown {
  position: absolute; top: -18px; left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  animation: bdCrownFloat 2s ease-in-out infinite;
}
.bd-modal-day-label {
  font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 8px;
}
.bd-modal-name {
  color: #fff; font-size: 28px; font-weight: 800;
  line-height: 1.2; margin-bottom: 6px;
}
.bd-modal-age {
  color: rgba(255,255,255,0.55); font-size: 16px; margin-bottom: 16px;
}
.bd-modal-wishes {
  display: inline-block;
  background: linear-gradient(90deg,#ff6b6b,#ffd93d,#6bcb77,#4d96ff);
  background-size: 300% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 20px; font-weight: 800;
  animation: bdRainbow 3s linear infinite;
}
.bd-modal-wishes-soon {
  color: rgba(255,255,255,0.5); font-size: 15px;
}
.bd-modal-sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bd-modal-sparkles span {
  position: absolute; color: #ffd93d; opacity: 0;
  animation: bdSparkle 2.5s ease-in-out infinite;
}
.bd-modal-sparkles span:nth-child(1) { left:8%;   top:15%; font-size:12px; animation-delay:0s;    }
.bd-modal-sparkles span:nth-child(2) { left:85%;  top:10%; font-size:18px; animation-delay:0.5s;  }
.bd-modal-sparkles span:nth-child(3) { left:75%;  top:75%; font-size:14px; animation-delay:1s;    }
.bd-modal-sparkles span:nth-child(4) { left:15%;  top:80%; font-size:10px; animation-delay:1.5s;  }
.bd-modal-sparkles span:nth-child(5) { left:50%;  top:5%;  font-size:16px; animation-delay:0.8s;  }
.bd-modal-sparkles span:nth-child(6) { left:90%;  top:50%; font-size:11px; animation-delay:2s;    }

/* ===== ANNIVERSAIRES — PREVIEW AUDIO ===== */
.bd-preview-wave {
  display: flex; align-items: center; gap: 3px; height: 20px;
}
.bd-preview-wave span {
  display: inline-block;
  width: 4px; border-radius: 2px;
  background: #ffd93d;
  animation: bdWave 1s ease-in-out infinite;
}
.bd-preview-wave span:nth-child(1) { height: 6px;  animation-delay: 0s;    }
.bd-preview-wave span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.bd-preview-wave span:nth-child(3) { height: 20px; animation-delay: 0.3s;  }
.bd-preview-wave span:nth-child(4) { height: 14px; animation-delay: 0.45s; }
.bd-preview-wave span:nth-child(5) { height: 6px;  animation-delay: 0.6s;  }
@keyframes bdWave {
  0%,100% { transform: scaleY(0.5); opacity: 0.6; }
  50%      { transform: scaleY(1);   opacity: 1;   }
}

/* ===== ANNIVERSAIRES — 2 boutons musique ===== */
.bd-music-ctrl { display: flex; gap: 6px; margin-left: auto; }
.bd-btn-synth { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: 50%; width: 36px; height: 36px; font-size: 16px; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.bd-btn-synth:hover { background: rgba(255,255,255,0.22); transform: scale(1.1); }
.bd-btn-synth.playing { background: linear-gradient(135deg,#4d96ff,#6bcb77); animation: bdMusicPulse 1s infinite; }

/* ===== Écriture Tamoul — mic pulse ===== */
@keyframes pulse-mic { 0% { box-shadow: 0 0 0 0 rgba(220,53,69,.5); } 70% { box-shadow: 0 0 0 18px rgba(220,53,69,0); } 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0); } }
.mic-active { animation: pulse-mic 1.5s infinite; }

/* ===== GALERIE PHOTOS & VIDÉOS (dashboard) ===== */
.gallery-carousel-card { padding: 12px 8px; background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.gallery-carousel { position: relative; display: flex; align-items: center; gap: 6px; }
.gallery-track-wrapper { flex: 1; overflow: hidden; border-radius: 8px; }
.gallery-track { display: flex; gap: 8px; transition: transform 0.4s ease; will-change: transform; }
.gallery-thumb { flex: 0 0 340px; height: 230px; border-radius: 8px; object-fit: cover; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; border: 2px solid transparent; }
.gallery-thumb:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(28,117,188,0.2); border-color: #4d96ff; }
.gallery-arrow { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #dee2e6; background: #fff; color: #333; font-size: 1.3rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, box-shadow 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.08); line-height: 1; }
.gallery-arrow:hover { background: #1c75bc; color: #fff; }
.gallery-video-thumb { position: relative; flex: 0 0 400px; height: 230px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid rgba(255,0,0,0.3); transition: transform 0.2s, box-shadow 0.2s; background: #000; }
.gallery-video-thumb:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(255,0,0,0.25); border-color: #ff0000; }
.gallery-video-thumb iframe { width: 100%; height: 100%; border: none; pointer-events: none; }
.gallery-video-thumb .video-click-zone { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.video-thumb-play-mini { position: absolute; bottom: 6px; right: 6px; width: 26px; height: 26px; background: rgba(255,0,0,0.9); border-radius: 50%; pointer-events: none; display: flex; align-items: center; justify-content: center; z-index: 2; }
.video-thumb-play-mini::after { content: ''; display: block; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 7px; border-color: transparent transparent transparent #fff; margin-left: 2px; }
.video-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.92); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.video-overlay iframe { width: 100%; max-width: 900px; aspect-ratio: 16/9; border: none; border-radius: 12px; }
.video-overlay-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 2.5rem; cursor: pointer; line-height: 1; z-index: 2001; }
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; cursor: pointer; }
.lightbox-overlay img { max-width: 94vw; max-height: 94vh; border-radius: 10px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); cursor: default; }
@media (max-width: 479px) {
  .gallery-track { gap: 4px; }
  .gallery-thumb, .gallery-video-thumb { flex: 0 0 calc(100vw - 90px); height: 220px; border-radius: 6px; }
  .gallery-arrow { flex: 0 0 28px; width: 28px; height: 28px; font-size: 1rem; }
}
