/* =====================================================
   mylists.css — Listes thématiques
   Regarde Movie
===================================================== */

/* =====================================================
   PAGE LAYOUT
===================================================== */
.lists-main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 100px 24px 80px;
  min-height: 80vh;
}

/* =====================================================
   EN-TÊTE
===================================================== */
.lists-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.lists-page-header-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 2px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.lists-page-header-text p {
  font-size: 0.95rem;
  color: var(--text-dim);
}

.lists-count-badge {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-create-list {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 11px 24px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn-create-list:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(229,9,20,0.3);
}

/* =====================================================
   ONGLETS
===================================================== */
.lists-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.lists-tab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.lists-tab:hover  { color: var(--text); }
.lists-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* =====================================================
   GRILLE DE LISTES
===================================================== */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* =====================================================
   CARTE DE LISTE
===================================================== */
.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}
.list-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  border-color: var(--border-hover);
}

/* Mosaïque de posters */
.list-card-mosaic {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: grid;
  background: var(--bg-surface);
}

.list-card-mosaic--1 { grid-template-columns: 1fr; }
.list-card-mosaic--2 { grid-template-columns: 1fr 1fr; }
.list-card-mosaic--3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.list-card-mosaic--4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.list-card-mosaic--3 img:first-child { grid-column: 1; grid-row: 1 / 3; }

.list-card-mosaic img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.list-card:hover .list-card-mosaic img { transform: scale(1.05); }

.list-card-mosaic--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
}

.list-card-body    { padding: 16px; }
.list-card-top     { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.list-card-emoji   { font-size: 1.4rem; }
.list-card-vis     { font-size: 1rem; color: var(--text-muted); }
.list-card-name    { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 5px; line-height: 1.3; }
.list-card-desc    { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-card-meta    { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

/* =====================================================
   ÉTAT VIDE
===================================================== */
.lists-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}

.lists-empty-icon { font-size: 4rem; display: block; margin-bottom: 8px; }
.lists-empty p    { color: var(--text-dim); font-size: 0.95rem; }

/* =====================================================
   MODAL CRÉATION
===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
  margin-bottom: 20px;
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 1.5px;
  color: var(--text);
}
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.8rem;
  cursor: pointer; line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.modal-body   { padding: 0 24px; }
.modal-footer {
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-top: 16px;
}
.field-label:first-child { margin-top: 0; }

.modal-body input,
.modal-body textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 11px 16px;
  outline: none;
  resize: none;
  transition: border-color 0.2s;
}
.modal-body input:focus,
.modal-body textarea:focus { border-color: var(--accent); }
.modal-body input::placeholder,
.modal-body textarea::placeholder { color: var(--text-muted); }

/* Picker emoji */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.emoji-opt {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  width: 44px; height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, transform 0.15s;
}
.emoji-opt:hover   { border-color: var(--border-hover); transform: scale(1.1); }
.emoji-opt.selected { border-color: var(--accent); background: rgba(229,9,20,0.08); }

/* Toggle visibilité */
.visibility-toggle {
  display: flex;
  gap: 8px;
}
.vis-btn {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.vis-btn.active {
  background: rgba(229,9,20,0.1);
  border-color: var(--accent);
  color: var(--text);
}
.vis-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 0;
}

.modal-error {
  background: rgba(229,9,20,0.08);
  border: 1px solid rgba(229,9,20,0.2);
  border-radius: 8px;
  color: #ff6b6b;
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-top: 12px;
}

.btn-modal-cancel {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 22px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-modal-cancel:hover { border-color: var(--border-hover); color: var(--text); }

.btn-modal-create {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-modal-create:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.btn-modal-create:disabled { opacity: 0.6; cursor: not-allowed; }

/* =====================================================
   DRAWER (panneau latéral)
===================================================== */
.list-drawer {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}
.list-drawer.hidden { display: none; }

.list-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.list-drawer-panel {
  position: relative;
  width: min(560px, 100vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideRight 0.3s ease;
  max-height: 100vh;
}

@keyframes slideRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* Header drawer */
.list-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-shrink: 0;
}

.list-drawer-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.list-drawer-emoji {
  font-size: 2.2rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.list-drawer-title-row h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.1;
  word-break: break-word;
}

.drawer-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.list-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drawer-icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.drawer-icon-btn:hover { border-color: var(--border-hover); color: var(--text); }
.drawer-icon-btn.danger:hover { border-color: #e50914; color: #e50914; }

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.drawer-close-btn:hover { background: var(--bg-surface); color: var(--text); }

/* Section ajout film */
.drawer-add-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-search-wrapper { position: relative; }

.drawer-search-wrapper input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 10px 18px;
  outline: none;
  transition: border-color 0.2s;
}
.drawer-search-wrapper input:focus { border-color: var(--accent); }
.drawer-search-wrapper input::placeholder { color: var(--text-muted); }

.drawer-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 100;
  overflow: hidden;
  display: none;
  max-height: 320px;
  overflow-y: auto;
}

.drawer-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: default;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.drawer-search-item:last-child { border-bottom: none; }
.drawer-search-item:hover { background: var(--bg-card-hover); }

.drawer-search-item img {
  width: 36px; height: 54px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.dsi-title { font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.dsi-meta  { font-size: 0.72rem; color: var(--text-muted); }

.dsi-add-btn {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s;
}
.dsi-add-btn:hover { background: var(--accent-hover); transform: scale(1.1); }

/* Section films */
.drawer-films-section {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.drawer-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.drawer-film-count {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.drawer-visibility-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  letter-spacing: 0.5px;
}
.drawer-visibility-badge.private {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}
.drawer-visibility-badge.public {
  background: rgba(34,197,94,0.12);
  color: #22c55e;
}

.drawer-films-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
}

.drawer-film-card { cursor: default; }

.drawer-film-img {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-surface);
  margin-bottom: 6px;
}
.drawer-film-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.drawer-film-img:hover img { transform: scale(1.04); }

.drawer-film-remove {
  position: absolute;
  top: 5px; right: 5px;
  background: rgba(229,9,20,0.85);
  color: #fff;
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-film-img:hover .drawer-film-remove { opacity: 1; }
.drawer-film-remove:hover { background: #e50914; }

.drawer-film-title {
  font-size: 0.75rem; font-weight: 600;
  color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.drawer-film-year  { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; }

.drawer-films-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  text-align: center;
}
.drawer-films-empty p { color: var(--text-dim); font-size: 0.9rem; }

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 600px) {
  .lists-main          { padding: 88px 16px 60px; }
  .lists-page-header   { flex-direction: column; align-items: flex-start; }
  .lists-grid          { grid-template-columns: 1fr 1fr; }
  .list-drawer-panel   { width: 100vw; }
  .drawer-films-grid   { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

@media (max-width: 400px) {
  .lists-grid { grid-template-columns: 1fr; }
}
