/* ─── Reset & Variables ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0f13;
  --surface:   #1a1a24;
  --surface2:  #22222f;
  --border:    #2e2e3f;
  --accent:    #7c6af7;
  --accent2:   #a78bfa;
  --text:      #e8e8f0;
  --muted:     #7a7a9a;
  --seen:      #22c55e;
  --watching:  #f59e0b;
  --want:      #7c6af7;
  --danger:    #ef4444;

  --nav-h:     56px;
  --filter-h:  49px;
  --radius:    12px;
  --radius-sm: 8px;
}

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Scrollbars ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ═══════════════════════════════════════════════════════════
   NAV
═══════════════════════════════════════════════════════════ */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo { font-weight: 700; font-size: 18px; color: var(--accent2); letter-spacing: -.5px; flex-shrink: 0; }

.nav-tabs { display: flex; gap: 4px; }
.nav-tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all .15s;
}
.nav-tab.active { background: var(--accent); color: #fff; }
.nav-tab:hover:not(.active) { background: var(--surface2); color: var(--text); }

.nav-right { display: flex; gap: 8px; align-items: center; }
.search-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text);
  font-size: 13px;
  width: 200px;
  outline: none;
  transition: border-color .15s;
}
.search-box:focus { border-color: var(--accent); }
.search-box::placeholder { color: var(--muted); }

.btn-add {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-add:hover { opacity: .85; }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all .15s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.btn-explore {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-explore:hover { border-color: var(--accent); color: var(--accent2); }

/* ═══════════════════════════════════════════════════════════
   FILTERS
═══════════════════════════════════════════════════════════ */
.filters {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  transition: all .15s;
}
.filter-chip.active  { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chip:hover:not(.active) { border-color: var(--accent); color: var(--accent2); }

.filter-sep { width: 1px; background: var(--border); margin: 2px 4px; align-self: stretch; }

/* ═══════════════════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: calc(100vh - var(--nav-h) - var(--filter-h));
}

.list-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px;
  min-width: 0;
}

.detail-panel {
  width: 420px;
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════
   LIST SECTIONS
═══════════════════════════════════════════════════════════ */
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title:first-child { margin-top: 0; }
.section-count {
  background: var(--surface2);
  color: var(--muted);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 20px;
}

/* ─── View toggle ────────────────────────────────────────────────────────────── */
.view-toggle { display: flex; gap: 3px; margin-left: auto; flex-shrink: 0; }
.view-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
  transition: all .15s;
}
.view-btn.active  { background: var(--surface2); border-color: var(--accent); color: var(--text); }
.view-btn:hover:not(.active) { border-color: var(--accent2); color: var(--accent2); }

/* ═══════════════════════════════════════════════════════════
   GRID VIEW (Mi lista)
═══════════════════════════════════════════════════════════ */
.grid-view-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.grid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.grid-card:hover { transform: translateY(-2px); }
.grid-card.selected { border-color: var(--accent); }

.grid-card-watching { background: rgba(245,158,11,.05); border-color: rgba(245,158,11,.2); }
.grid-card-watching:hover,.grid-card-watching.selected { border-color: var(--watching); background: rgba(245,158,11,.1); }
.grid-card-want     { background: rgba(124,106,247,.05); border-color: rgba(124,106,247,.2); }
.grid-card-want:hover,.grid-card-want.selected         { border-color: var(--accent);   background: rgba(124,106,247,.1); }
.grid-card-seen     { background: rgba(34,197,94,.05);  border-color: rgba(34,197,94,.2);  }
.grid-card-seen:hover,.grid-card-seen.selected         { border-color: var(--seen);     background: rgba(34,197,94,.1);  }

.grid-card-poster {
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--surface2);
}
.grid-card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-card-no-poster {
  width: 100%; aspect-ratio: 2/3;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--muted);
}
.grid-card-body   { padding: 8px 10px 10px; }
.grid-card-title  { font-size: 12px; font-weight: 600; line-height: 1.3; margin-bottom: 5px; }
.grid-card-badges { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; }

/* ═══════════════════════════════════════════════════════════
   GRID VIEW (Explorar)
═══════════════════════════════════════════════════════════ */
.explore-grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.explore-grid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
  display: flex;
  flex-direction: column;
}
.explore-grid-card:hover { border-color: var(--accent); }
.explore-grid-poster { position: relative; aspect-ratio: 2/3; overflow: hidden; background: var(--surface2); flex-shrink: 0; }
.explore-grid-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-in-list {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.7); color: #4caf50;
  font-size: 12px; font-weight: 700;
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.grid-add-btn {
  position: absolute; bottom: 6px; right: 6px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 50%; width: 24px; height: 24px;
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.explore-grid-card:hover .grid-add-btn { opacity: 1; }
.explore-grid-no-poster {
  width: 100%; aspect-ratio: 2/3;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--muted);
}
.explore-grid-body  { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.explore-grid-title { font-size: 12px; font-weight: 600; line-height: 1.3; }
.explore-grid-meta  { font-size: 10px; color: var(--muted); }
.explore-grid-btn   { width: 100%; font-size: 11px; padding: 5px 8px; margin-top: auto; }

/* ═══════════════════════════════════════════════════════════
   LIST ITEMS
═══════════════════════════════════════════════════════════ */
.list-view { display: flex; flex-direction: column; gap: 6px; }

.list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.list-item-watching { background: rgba(245,158,11,.05); border-color: rgba(245,158,11,.2); }
.list-item-want     { background: rgba(124,106,247,.05); border-color: rgba(124,106,247,.2); }
.list-item-seen     { background: rgba(34,197,94,.05);  border-color: rgba(34,197,94,.2);  }

.list-item-watching:hover, .list-item-watching.selected { background: rgba(245,158,11,.1); border-color: var(--watching); }
.list-item-want:hover,     .list-item-want.selected     { background: rgba(124,106,247,.1); border-color: var(--accent); }
.list-item-seen:hover,     .list-item-seen.selected     { background: rgba(34,197,94,.1);  border-color: var(--seen); }

.list-thumb {
  width: 54px;
  flex-shrink: 0;
  overflow: hidden;
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--surface2) 0%, #252535 100%);
}

.list-body {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.list-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.list-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.list-year-type { font-size: 11px; color: var(--muted); white-space: nowrap; }

.list-badges { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

.list-summary {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Season chips on list items */
.list-seasons { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }

.season-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  white-space: nowrap;
}
.season-chip.complete { border-color: #14532d; color: var(--seen);     background: #0d2218; }
.season-chip.partial  { border-color: #451a03; color: var(--watching); background: #1f0f00; }
.season-chip.upcoming { border-color: var(--border); color: var(--muted); }

/* ═══════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════ */
.badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.badge-seen     { background: #14532d; color: var(--seen); }
.badge-watching { background: #451a03; color: var(--watching); }
.badge-want     { background: #2e1065; color: var(--accent2); }

.badge-rating {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: #1a1a10;
  color: #f5c518;
  border: 1px solid #3a3a10;
  white-space: nowrap;
}

.plat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .3px;
  white-space: nowrap;
}
.plat-prime    { background: #1a3a5c; color: #00a8e0; }
.plat-apple    { background: #2a2a2a; color: #f5f5f7; }
.plat-movistar { background: #003087; color: #009ee0; }
.plat-hbo      { background: #3a1f5a; color: #b07fff; }
.plat-disney   { background: #0f1b6e; color: #5c89ff; }
.plat-sky      { background: #1a3a2a; color: #00c878; }

/* ═══════════════════════════════════════════════════════════
   DETAIL PANEL
═══════════════════════════════════════════════════════════ */
.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.detail-empty-icon { font-size: 40px; opacity: .4; }

.mobile-back {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--accent2);
  font-size: 13px;
  width: 100%;
  text-align: left;
}

.detail-poster-wrap {
  position: relative;
  height: 240px;
  overflow: hidden;
  flex-shrink: 0;
}
.detail-poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-poster-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--surface2) 0%, #252535 100%);
}
.detail-poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--surface) 100%);
}
.detail-poster-badges {
  position: absolute;
  bottom: 12px;
  left: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-body { padding: 0 20px 32px; }

.detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
  margin-top: 2px;
}
.detail-meta { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

/* Ratings row */
.ratings-row { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.rating-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  min-width: 76px;
}
.rating-label { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.rating-value { font-size: 18px; font-weight: 700; }
.rating-tmdb .rating-value { color: #f5c518; }
.rating-imdb .rating-value { color: #f5c518; }
.rating-rt   .rating-value { color: #fa320a; }
.rating-mine .rating-value { color: var(--accent2); }
.my-rating-row { display: flex; gap: 2px; margin-top: 4px; }
.my-star { font-size: 18px; color: var(--border); cursor: pointer; transition: color .1s; line-height: 1; }
.my-star.on { color: #f59e0b; }
.my-star:hover { color: #f59e0b; }

/* Inline fields grid */
.detail-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.inline-field { display: flex; flex-direction: column; gap: 4px; }
.inline-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.inline-select, .inline-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.inline-select:focus, .inline-input:focus { border-color: var(--accent); }

/* Where left off */
.where-left-off {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.where-left-off .inline-select { flex: 1; }

/* Detail section label */
.detail-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  margin-top: 20px;
}
.detail-na { font-size: 12px; color: var(--muted); }

.detail-synopsis { font-size: 13px; line-height: 1.7; color: #c8c8d8; }

/* Cast */
.cast-list { display: flex; gap: 6px; flex-wrap: wrap; }
.cast-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
}
.cast-name { font-weight: 600; }
.cast-role { color: var(--muted); font-size: 11px; }

/* Seasons detail */
.seasons-detail { display: flex; flex-direction: column; gap: 8px; }
.season-row {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.season-row-name { font-size: 13px; font-weight: 700; min-width: 28px; color: var(--muted); }
.season-row-bar-wrap { flex: 1; }
.season-row-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.season-row-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.season-row-fill { height: 100%; border-radius: 2px; transition: width .3s; }
.fill-complete { background: var(--seen); }
.fill-partial  { background: var(--watching); }
.fill-upcoming { background: var(--border); width: 0 !important; }
.season-row-status { font-size: 16px; }

/* Note textarea */
.detail-note-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 10px 12px;
  resize: none;
  outline: none;
  line-height: 1.6;
  min-height: 80px;
  transition: border-color .15s;
}
.detail-note-input:focus { border-color: var(--accent); }
.detail-note-input::placeholder { color: var(--muted); }

/* Detail action buttons */
.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.btn-edit, .btn-refresh, .btn-delete {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  transition: all .15s;
}
.btn-edit    { color: var(--accent2); border-color: var(--accent); }
.btn-edit:hover { background: var(--accent); color: #fff; }
.btn-refresh { color: var(--muted); }
.btn-refresh:hover { border-color: var(--accent2); color: var(--accent2); }
.btn-delete  { color: var(--danger); border-color: #3f1515; }
.btn-delete:hover { background: var(--danger); color: #fff; }

/* ═══════════════════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  padding: 16px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: var(--surface2);
  border: none;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* Search phase */
.modal-search-phase { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }

.modal-search-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s;
}
.modal-search-input:focus { border-color: var(--accent); }
.modal-search-input::placeholder { color: var(--muted); }

.modal-search-results { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; }

.search-result-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color .15s;
}
.search-result-card:hover { border-color: var(--accent); }
.search-result-card img { width: 36px; height: 54px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.result-no-poster { width: 36px; height: 54px; background: var(--border); border-radius: 4px; flex-shrink: 0; }
.result-title { font-size: 13px; font-weight: 600; }
.result-meta  { font-size: 11px; color: var(--muted); }

.search-loading, .search-empty { font-size: 13px; color: var(--muted); padding: 16px; text-align: center; }

/* Form phase */
.modal-form-phase { display: flex; flex-direction: column; overflow: hidden; }

.modal-selected-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-selected-info { display: flex; align-items: center; gap: 12px; }
.modal-poster { width: 40px; height: 60px; object-fit: cover; border-radius: 6px; }
.modal-selected-title { font-size: 15px; font-weight: 700; }
.modal-selected-meta  { font-size: 12px; color: var(--muted); }

.modal-form {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-inline { display: flex; gap: 8px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.form-select, .form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s;
}
.form-select:focus, .form-input:focus { border-color: var(--accent); }
.form-row-inline .form-select { flex: 1; }

.form-stars { display: flex; gap: 4px; }
.form-star { font-size: 22px; color: var(--border); cursor: pointer; transition: color .1s; }
.form-star.on { color: #f59e0b; }
.form-star:hover { color: #f59e0b; }

.form-textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  resize: vertical;
  outline: none;
  min-height: 70px;
  line-height: 1.5;
  transition: border-color .15s;
}
.form-textarea:focus { border-color: var(--accent); }
.form-textarea::placeholder { color: var(--muted); }

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: .85; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: all .15s;
}
.btn-secondary:hover { border-color: var(--accent2); color: var(--accent2); }

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY
═══════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.loading-overlay.visible { opacity: 1; pointer-events: all; }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 900;
  transition: transform .25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.toast-success { border-color: var(--seen); }
.toast.toast-error   { border-color: var(--danger); }

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}
.empty-icon { font-size: 40px; opacity: .4; }

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: -.5px;
  text-align: center;
  margin-bottom: 8px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 5px;
}
.login-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.login-input:focus { border-color: var(--accent); }
.login-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin-top: 6px;
  transition: opacity .15s;
}
.login-btn:hover { opacity: .85; }
.login-btn:disabled { opacity: .5; cursor: default; }
.login-error {
  background: #2d1515;
  border: 1px solid #5a2020;
  color: #f87171;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
}
.login-error.visible { display: block; }

/* ═══════════════════════════════════════════════════════════
   EXPLORE PAGE
═══════════════════════════════════════════════════════════ */
.explore-layout {
  padding: 20px 24px;
  min-height: calc(100vh - var(--nav-h));
}

.explore-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.explore-search {
  flex: 1;
  min-width: 200px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 8px 14px;
  outline: none;
  transition: border-color .15s;
}
.explore-search:focus { border-color: var(--accent); }
.explore-search::placeholder { color: var(--muted); }

.type-tabs { display: flex; gap: 4px; }
.type-tab {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all .15s;
}
.type-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.type-tab:hover:not(.active) { border-color: var(--accent2); color: var(--accent2); }

.platform-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.platform-chips::-webkit-scrollbar { display: none; }
.platform-chip {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all .15s;
}
.platform-chip.active { border-color: var(--accent); color: var(--text); background: var(--surface2); }
.platform-chip:hover:not(.active) { border-color: var(--border); color: var(--text); }

.explore-sort { display: flex; gap: 4px; }
.sort-btn {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: all .15s;
  white-space: nowrap;
}
.sort-btn.active { background: var(--surface2); border-color: var(--accent); color: var(--text); }
.sort-btn:hover:not(.active) { border-color: var(--accent2); color: var(--accent2); }

.genre-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.genre-chips::-webkit-scrollbar { display: none; }
.genre-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.genre-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.genre-chip:hover:not(.active) { border-color: var(--accent2); color: var(--accent2); }

.explore-loading {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.explore-results { display: flex; flex-direction: column; gap: 8px; }
.explore-results.explore-grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.explore-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  transition: border-color .15s;
}
.explore-card:hover { border-color: var(--accent); }

.explore-card-poster {
  width: 54px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
}
.explore-card-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.explore-card-body {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
}
.explore-card-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.explore-card-meta  { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.explore-card-synopsis {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.explore-card-action {
  padding: 0 14px;
  flex-shrink: 0;
}
.btn-add-list {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity .15s;
}
.btn-add-list:hover { opacity: .85; }
.btn-add-list:disabled { opacity: .5; cursor: default; }
.in-list-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--seen);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .detail-panel { width: 360px; }
}

/* ─── Mobile bottom nav ──────────────────────────────────────────────────────── */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  nav { padding: 0 14px; }
  .nav-tabs { display: none; }
  .search-box { width: 140px; }
  .btn-explore { display: none; }

  .filters { padding: 10px 14px; }

  .app-layout { height: calc(100vh - var(--nav-h) - var(--filter-h) - 56px); }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 150;
  }
  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
  }
  .mobile-nav-item.active { color: var(--accent2); }
  .mobile-nav-item:hover  { color: var(--text); }
  .mobile-nav-icon { font-size: 20px; line-height: 1; }

  .explore-layout { padding-bottom: 70px; }

  .platform-chips,
  .genre-chips { flex-wrap: nowrap; }

  .platform-chip,
  .genre-chip   { flex-shrink: 0; }

  .list-panel  { padding: 14px; }
  .detail-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    z-index: 200;
    transform: translateX(100%);
    transition: transform .25s ease;
    border-left: none;
    background: var(--bg);
  }
  .detail-panel.mobile-visible { transform: translateX(0); }
  .list-panel.mobile-hidden { display: none; }
  .mobile-back { display: flex; }

  .detail-inline-grid { grid-template-columns: 1fr 1fr; }

  .explore-layout { padding: 14px; }

  /* En móvil el botón + siempre visible (sin hover táctil) */
  .grid-add-btn { opacity: 1; }
}

@media (max-width: 500px) {
  .search-box { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .detail-inline-grid { grid-template-columns: 1fr; }
}
