/* ═══════════════════════════════════════════════════════════
   SALSA TIMBAYONNE — Design System
   Palette : nuit cubaine — noir profond, or chaud, corail vif
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────── */
:root {
  --bg:          #0e0b10;
  --bg-card:     #1a1520;
  --bg-card2:    #221c2a;
  --border:      #2e2638;

  --gold:        #d4a843;
  --gold-light:  #f0c96a;
  --coral:       #e85d4a;
  --coral-light: #ff7c6b;
  --teal:        #3aada0;

  --text:        #f0eaf5;
  --text-muted:  #9a8fab;
  --text-dim:    #6b5f78;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --radius:      12px;
  --radius-sm:   6px;
  --shadow:      0 8px 32px rgba(0,0,0,.5);
  --shadow-sm:   0 2px 12px rgba(0,0,0,.3);

  --transition:  .25s cubic-bezier(.4,0,.2,1);
  --header-h:    68px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; border-radius: var(--radius-sm); }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ═══════════════════════════════════════════════════════════
   ÉCRAN DE CONNEXION
   ═══════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 30% 60%, rgba(212,168,67,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 75% 20%, rgba(232,93,74,.10) 0%, transparent 55%),
    var(--bg);
  z-index: 1000;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow);
  animation: fadeUp .4s ease both;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo .logo-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.login-logo h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
}
.login-logo h1 em {
  font-style: italic;
  color: var(--gold);
}
.login-logo p { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  transition: border-color var(--transition);
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
}

.login-error {
  background: rgba(232,93,74,.15);
  border: 1px solid var(--coral);
  border-radius: var(--radius-sm);
  color: var(--coral-light);
  padding: 10px 14px;
  font-size: .875rem;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════
   BOUTONS
   ═══════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--coral) 100%);
  color: #0e0b10;
  font-weight: 700;
  font-size: .95rem;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition), transform var(--transition);
  border: none;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: border-color var(--transition), background var(--transition);
}
.btn-secondary:hover { border-color: var(--gold); background: rgba(212,168,67,.08); }

.btn-danger {
  background: rgba(232,93,74,.15);
  border: 1px solid rgba(232,93,74,.4);
  color: var(--coral-light);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  transition: background var(--transition);
}
.btn-danger:hover { background: rgba(232,93,74,.25); }

.btn-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--gold); color: var(--gold); }

.btn-spinner { display: inline-block; animation: spin 1s linear infinite; }

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(14,11,16,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 900;
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
}

.site-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.logo-dance { font-size: 1.5rem; }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
}
.logo-text em { color: var(--gold); font-style: italic; }

.main-nav {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text); background: var(--bg-card2); }
.nav-link.active {
  color: var(--gold);
  background: rgba(212,168,67,.1);
}
.nav-admin { color: var(--teal) !important; }

.header-actions {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.user-badge {
  font-size: .75rem;
  color: var(--text-dim);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}
.btn-logout {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: color var(--transition);
  padding: 4px 8px;
}
.btn-logout:hover { color: var(--coral-light); }

.nav-toggle { display: none; font-size: 1.4rem; color: var(--text); padding: 4px; }

/* ═══════════════════════════════════════════════════════════
   MAIN / PAGES
   ═══════════════════════════════════════════════════════════ */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; padding-top: var(--header-h); }
.page { animation: fadeUp .3s ease both; }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  height: calc(100vh - var(--header-h));
  min-height: 500px;
  display: flex; align-items: center;
  background:
    url('assets/img/hero-bg.jpg') center center / cover no-repeat,
    linear-gradient(135deg, #1a0a22 0%, #0e1a20 100%);
  overflow: hidden;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    135deg,
    rgba(14,11,16,.85) 0%,
    rgba(14,11,16,.6) 60%,
    rgba(14,11,16,.4) 100%
  );
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 700px;
  padding: 0 48px;
}
.hero-eyebrow {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--gold);
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero-title em { color: var(--gold); font-style: italic; }
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.7;
}
.hero-cta .btn-primary { width: auto; padding: 14px 32px; }

/* ── Home cards ─────────────────────────────────────────── */
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 56px;
  padding-bottom: 56px;
}
.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.home-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(212,168,67,.12);
}
.hc-icon { font-size: 2.2rem; }
.home-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold-light);
}
.home-card p { color: var(--text-muted); font-size: .9rem; }

/* ── Page header ────────────────────────────────────────── */
.page-header {
  padding: 48px 24px 32px;
  border-bottom: 1px solid var(--border);
}
.page-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 6px;
}
.page-header p { color: var(--text-muted); font-size: .95rem; }

/* ── Items Grid ─────────────────────────────────────────── */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding: 40px 24px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
}
.item-card:hover {
  border-color: rgba(212,168,67,.5);
  transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(0,0,0,.4);
}

.item-card-media {
  position: relative;
  background: var(--bg-card2);
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.item-card-media .media-thumb {
  width: 100%; height: 100%; object-fit: cover;
}
.item-card-media .media-placeholder {
  font-size: 3rem;
  opacity: .4;
}
.item-card-media .play-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
  opacity: 0;
  transition: opacity var(--transition);
}
.item-card:hover .play-badge { opacity: 1; }
.play-badge-icon {
  width: 52px; height: 52px;
  background: rgba(212,168,67,.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #0e0b10;
}

.item-card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.item-rank-year {
  display: flex; align-items: center; gap: 8px;
}
.item-rank {
  background: var(--gold);
  color: #0e0b10;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.item-year {
  font-size: .75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.item-type-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(14,11,16,.8);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .7rem;
  color: var(--text-muted);
  backdrop-filter: blur(4px);
}

.item-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.35;
}

.item-comment-preview {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
}

/* loading & vide */
.grid-loading, .grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}
.grid-loading .spinner {
  font-size: 2rem;
  display: block;
  margin-bottom: 16px;
  animation: spin 1.2s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(6px);
  z-index: 950;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .2s ease;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
  animation: fadeUp .3s ease;
}
.modal-close {
  position: sticky; top: 0; float: right;
  z-index: 1;
  width: 36px; height: 36px;
  margin: 16px 16px 0 0;
  border-radius: 50%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--coral-light); border-color: var(--coral); }

.modal-body { padding: 32px; }

.modal-media { margin-bottom: 24px; border-radius: var(--radius-sm); overflow: hidden; }
.modal-media video { width: 100%; display: block; max-height: 480px; background: #000; }
.modal-media img { width: 100%; display: block; }
.modal-media .pdf-link {
  display: flex; align-items: center; gap: 12px;
  padding: 20px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-weight: 600;
  transition: background var(--transition);
}
.modal-media .pdf-link:hover { background: rgba(212,168,67,.08); }

.modal-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 12px;
  line-height: 1.25;
}
.modal-comment {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: .95rem;
}
.modal-comment h1,.modal-comment h2,.modal-comment h3 {
  font-family: var(--font-display);
  color: var(--gold-light);
  margin: 16px 0 8px;
}
.modal-comment strong { color: var(--text); }
.modal-comment em { color: var(--gold-light); }
.modal-comment ul, .modal-comment ol {
  padding-left: 20px;
  margin: 8px 0;
}
.modal-comment li { margin-bottom: 4px; }
.modal-comment a { color: var(--teal); text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════
   ADMINISTRATION
   ═══════════════════════════════════════════════════════════ */
.admin-wrap { padding: 32px 24px; }

.admin-tabs {
  display: flex; gap: 8px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.admin-tab {
  padding: 10px 20px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-card2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table .col-rank { width: 60px; text-align: center; }
.admin-table .col-year { width: 110px; }
.admin-table .col-type { width: 80px; }
.admin-table .col-actions { width: 110px; text-align: right; }

.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.admin-toolbar h3 { font-family: var(--font-display); font-size: 1.2rem; }

/* ── Formulaire admin ─────────────────────────────────── */
.admin-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 700px;
}
.admin-form h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  transition: border-color var(--transition);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: var(--gold); }
.form-field select option { background: var(--bg-card2); }
.form-field textarea { resize: vertical; min-height: 80px; }

/* Quill dark override */
.ql-toolbar { background: var(--bg-card2); border-color: var(--border) !important; }
.ql-container { background: var(--bg-card2); border-color: var(--border) !important; }
.ql-editor { color: var(--text); min-height: 140px; }
.ql-snow .ql-stroke { stroke: var(--text-muted); }
.ql-snow .ql-fill { fill: var(--text-muted); }
.ql-snow.ql-toolbar button:hover .ql-stroke { stroke: var(--gold); }

.form-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: .875rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.form-upload-zone:hover, .form-upload-zone.drag-over {
  border-color: var(--gold);
  background: rgba(212,168,67,.05);
}
.form-upload-zone input[type=file] { display: none; }
.upload-progress {
  margin-top: 12px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--coral));
  width: 0%;
  transition: width .3s ease;
}

.form-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: .8rem;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .home-cards { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .form-field.full { grid-column: 1; }
}

@media (max-width: 700px) {
  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    z-index: 899;
  }
  .main-nav.open { display: flex; }
  .nav-link { width: 100%; }
  .nav-toggle { display: block; }
  .hero-content { padding: 0 24px; }
  .home-cards { padding: 32px 24px; }
  .user-badge { display: none; }
  .admin-form { padding: 20px; }
  .modal-body { padding: 20px; }
}
