/* ================================================================
   WETOON — style.css
   Design : dark, éditorial, typographie expressive
   Fonts  : Bebas Neue (display) + DM Sans (body)
================================================================ */

/* ── IMPORT FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ================================================================
   VARIABLES
================================================================ */
:root {
  /* Fonds */
  --bg:          #0b0c0f;
  --bg2:         #111318;
  --bg3:         #181b22;
  --surface:     #1e2130;
  --surface2:    #252a3a;

  /* Bordures */
  --border:      rgba(255,255,255,.07);
  --border-md:   rgba(255,255,255,.12);
  --border-lg:   rgba(255,255,255,.18);

  /* Accents */
  --accent:      #e63946;
  --accent-dark: #c72a36;
  --accent2:     #ff6b35;
  --gold:        #f4c430;
  --teal:        #2ec4b6;
  --purple:      #7b5ea7;

  /* Texte */
  --text:        #e8eaf0;
  --text-sec:    #a8adc0;
  --muted:       #7a7f94;
  --faint:       #3a3f52;
  --faint2:      #272b3a;

  /* Statuts */
  --green:       #4caf50;
  --yellow:      #f4c430;
  --red:         #e63946;

  /* Typographie */
  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Courier New', monospace;

  /* Sizing */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  /* Transitions */
  --t-fast:      .12s ease;
  --t-med:       .22s ease;
  --t-slow:      .4s ease;

  /* Ombres */
  --shadow-sm:   0 2px 8px rgba(0,0,0,.3);
  --shadow-md:   0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:   0 20px 60px rgba(0,0,0,.55);

  /* Layout */
  --max-w:       1400px;
  --nav-h:       64px;
}

/* ================================================================
   RESET & BASE
================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

ul, ol { list-style: none; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

input, textarea, select {
  font-family: var(--font-body);
}

/* ================================================================
   SCROLLBAR
================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint2); }

/* ================================================================
   TYPOGRAPHIE
================================================================ */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: .5px;
}

h1 { font-size: clamp(36px, 5vw, 64px); }
h2 { font-size: clamp(24px, 3vw, 36px); }
h3 { font-size: clamp(18px, 2vw, 24px); }
h4 { font-size: 18px; }

p { line-height: 1.7; }

.text-accent  { color: var(--accent); }
.text-muted   { color: var(--muted); }
.text-sec     { color: var(--text-sec); }
.text-gold    { color: var(--gold); }
.text-teal    { color: var(--teal); }

/* ================================================================
   LAYOUT UTILITAIRES
================================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: .5px;
}
.section-title span { color: var(--accent); }

.section-link {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
  flex-shrink: 0;
}
.section-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }
.gap-24       { gap: 24px; }

/* ================================================================
   BOUTONS
================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast),
              box-shadow var(--t-fast);
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: scale(.97); }

/* Accent rouge */
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(230,57,70,.35);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-md);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-lg);
  background: var(--surface);
}

/* Surface */
.btn-surface {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-surface:hover { background: var(--surface2); }

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(230,57,70,.3);
}
.btn-danger:hover { background: rgba(230,57,70,.1); }

/* Tailles */
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* Icon only */
.btn-icon {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: all var(--t-fast);
}
.btn-icon:hover { color: var(--text); border-color: var(--border-md); }

/* ================================================================
   FORMULAIRES
================================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg3);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--faint); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230,57,70,.12);
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7f94' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 2px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ================================================================
   CARTES SÉRIE
================================================================ */
.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  cursor: pointer;
  transition: transform var(--t-med), box-shadow var(--t-med), border-color var(--t-med);
  border: 1px solid var(--border);
  display: block;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--faint);
}

.card-cover {
  aspect-ratio: 2/3;
  background: var(--surface);
  overflow: hidden;
  position: relative;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.card:hover .card-cover img { transform: scale(1.06); }

.card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--faint);
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg2) 100%);
}

/* Badges type */
.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  color: #fff;
  z-index: 2;
}
.badge-webtoon  { background: #534AB7; }
.badge-manga    { background: var(--accent); }
.badge-manhwa   { background: #0F7B64; }
.badge-manhua   { background: #9B6B1A; }

/* Badge NEW */
.card-new {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--gold);
  color: #000;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}

/* Overlay hover */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11,12,15,.96) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--t-med);
  z-index: 1;
}
.card:hover .card-overlay { opacity: 1; }

.card-hover-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  z-index: 3;
  transform: translateY(6px);
  opacity: 0;
  transition: transform var(--t-med), opacity var(--t-med);
}
.card:hover .card-hover-info { transform: translateY(0); opacity: 1; }

.card-hover-ch {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 3px;
}
.card-hover-date { font-size: 11px; color: var(--muted); }

/* Info sous la cover */
.card-info { padding: 10px 10px 12px; }
.card-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.card-meta { font-size: 11px; color: var(--muted); }

/* Grille de cartes */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

/* ================================================================
   BADGES & PILLS
================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-accent  { background: rgba(230,57,70,.15); color: var(--accent); }
.badge-gold    { background: rgba(244,196,48,.15); color: var(--gold); }
.badge-teal    { background: rgba(46,196,182,.15); color: var(--teal); }
.badge-muted   { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }

.statut-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}
.statut-en_cours .statut-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.statut-termine  .statut-dot { background: var(--muted); }
.statut-pause    .statut-dot { background: var(--gold); }
.statut-annule   .statut-dot { background: var(--red); }

/* ================================================================
   TAGS GENRE
================================================================ */
.genre-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-md);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-sec);
  transition: all var(--t-fast);
}
.genre-pill:hover {
  background: rgba(230,57,70,.1);
  border-color: rgba(230,57,70,.3);
  color: var(--accent);
}

/* ================================================================
   FILTRES
================================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-md);
  background: var(--bg2);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: var(--font-body);
}
.filter-btn:hover  { border-color: var(--faint); color: var(--text); background: var(--surface); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ================================================================
   PAGINATION
================================================================ */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--t-fast);
  padding: 0 10px;
}
.page-btn:hover  { background: var(--surface2); color: var(--text); border-color: var(--border-md); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ================================================================
   ALERTES / MESSAGES
================================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid;
  margin-bottom: 16px;
}
.alert-error   { background: rgba(230,57,70,.08);  border-color: rgba(230,57,70,.25);  color: #f5a0a6; }
.alert-success { background: rgba(76,175,80,.08);  border-color: rgba(76,175,80,.25);  color: #95d99a; }
.alert-info    { background: rgba(46,196,182,.08); border-color: rgba(46,196,182,.25); color: #7ee8e1; }
.alert-warn    { background: rgba(244,196,48,.08); border-color: rgba(244,196,48,.25); color: #f9dc78; }

/* ================================================================
   TOAST NOTIFICATION
================================================================ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  z-index: 9999;
  max-width: 340px;
  box-shadow: var(--shadow-md);
  transform: translateY(80px);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ================================================================
   MODAL
================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11,12,15,.85);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med);
  padding: 24px;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg3);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  transform: scale(.95) translateY(10px);
  transition: transform var(--t-med);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: color var(--t-fast);
}
.modal-close:hover { color: var(--text); }

/* ================================================================
   TABLE ADMIN
================================================================ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table thead {
  background: var(--surface);
  border-bottom: 1px solid var(--border-md);
}
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr {
  transition: background var(--t-fast);
}
.table tbody tr:hover { background: rgba(255,255,255,.025); }

/* ================================================================
   UPLOAD ZONE
================================================================ */
.upload-zone {
  border: 2px dashed var(--border-md);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  background: var(--bg2);
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(230,57,70,.04);
}
.upload-zone-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: .5;
}
.upload-zone-text {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
.upload-zone-hint { font-size: 12px; color: var(--faint); }

/* ================================================================
   LOADER / SPINNER
================================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-md);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================================================================
   EMPTY STATE
================================================================ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 54px;
  margin-bottom: 16px;
  opacity: .6;
}
.empty-state-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-sec);
  margin-bottom: 8px;
}
.empty-state-text { font-size: 14px; line-height: 1.7; }

/* ================================================================
   COMMENTAIRES
================================================================ */
.comment {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-pseudo { font-size: 13px; font-weight: 500; }
.comment-date   { font-size: 12px; color: var(--muted); }
.comment-text   { font-size: 14px; color: var(--text-sec); line-height: 1.65; word-break: break-word; }

/* ================================================================
   ANIMATIONS GLOBALES
================================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.anim      { animation: fadeUp .5s ease both; }
.anim-1    { animation-delay: .05s; }
.anim-2    { animation-delay: .10s; }
.anim-3    { animation-delay: .15s; }
.anim-4    { animation-delay: .20s; }
.anim-5    { animation-delay: .25s; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
}

@media (max-width: 900px) {
  :root { --nav-h: 56px; }
  h1 { font-size: clamp(28px, 6vw, 46px); }
  .section { padding: 40px 0; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
  .section-title { font-size: 24px; }
  .modal { padding: 24px; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card-info { padding: 8px 8px 10px; }
  .card-title { font-size: 12px; }
  .section { padding: 28px 0; }
  .toast { bottom: 16px; right: 16px; left: 16px; max-width: none; }
}