/* ══════════════════════════════════════
   TEMPORADAS — OKIRU
   Adicione ao index.html:
     <link rel="stylesheet" href="temporadas.css">  → no <head>
     <script src="temporadas.js"></script>           → após script.js
══════════════════════════════════════ */

/* ─────────────────────────────────
   SEÇÃO NO MODAL DE DETALHE
───────────────────────────────── */
.temp-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Cabeçalho colapsável ── */
.temp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1.5px solid rgba(108, 122, 224, 0.12);
  background: rgba(108, 122, 224, 0.04);
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.temp-header:hover {
  background: rgba(108, 122, 224, 0.09);
  border-color: rgba(108, 122, 224, 0.22);
}
.temp-header.open {
  border-radius: 16px 16px 0 0;
  border-bottom-color: transparent;
  background: rgba(108, 122, 224, 0.08);
}
body.dark .temp-header {
  background: rgba(108, 122, 224, 0.07);
  border-color: rgba(108, 122, 224, 0.18);
}
body.dark .temp-header:hover,
body.dark .temp-header.open {
  background: rgba(108, 122, 224, 0.13);
}

.temp-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.temp-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6c7ae0 0%, #a78bfa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.temp-header-icon svg {
  width: 16px;
  height: 16px;
  stroke: white;
}

.temp-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.temp-header-title {
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #2d2f4a;
  line-height: 1.2;
}
body.dark .temp-header-title { color: #e0e0f0; }

.temp-header-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #8b8fad;
}
body.dark .temp-header-sub { color: #6b7090; }

.temp-header-badge {
  background: linear-gradient(135deg, #6c7ae0, #a78bfa);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
}

.temp-chevron {
  width: 20px;
  height: 20px;
  color: #8b8fad;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.temp-header.open .temp-chevron {
  transform: rotate(180deg);
}

/* ── Corpo expansível ── */
.temp-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid rgba(108, 122, 224, 0.12);
  border-top: none;
  border-radius: 0 0 16px 16px;
  background: rgba(108, 122, 224, 0.03);
}
body.dark .temp-body {
  border-color: rgba(108, 122, 224, 0.18);
  background: rgba(108, 122, 224, 0.05);
}
.temp-body.open {
  max-height: 600px;
}

.temp-body-inner {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Campo de busca expansível ── */
.temp-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.temp-search-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(108, 122, 224, 0.2);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.temp-search-toggle:hover {
  background: rgba(108, 122, 224, 0.08);
  border-color: rgba(108, 122, 224, 0.4);
}
.temp-search-toggle:active { transform: scale(0.92); }
.temp-search-toggle svg {
  width: 16px;
  height: 16px;
  stroke: #6c7ae0;
}
body.dark .temp-search-toggle {
  background: rgba(255,255,255,0.05);
  border-color: rgba(108, 122, 224, 0.25);
}

/* Input de busca — aparece ao expandir */
.temp-search-input-wrap {
  flex: 1;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  transition: max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
}
.temp-search-input-wrap.expanded {
  max-width: 400px;
  opacity: 1;
}

.temp-search-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid rgba(108, 122, 224, 0.25);
  background: white;
  padding: 0 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #2d2f4a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.temp-search-input:focus {
  border-color: #6c7ae0;
  box-shadow: 0 0 0 3px rgba(108, 122, 224, 0.15);
}
.temp-search-input::placeholder { color: #aaa; }
body.dark .temp-search-input {
  background: rgba(255,255,255,0.06);
  border-color: rgba(108, 122, 224, 0.3);
  color: #e0e0f0;
}
body.dark .temp-search-input::placeholder { color: #555; }

/* Botão clear do input */
.temp-search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(108, 122, 224, 0.15);
  color: #6c7ae0;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: -4px;
  transition: background 0.15s;
}
.temp-search-clear.visible { display: flex; }
.temp-search-clear:hover { background: rgba(108, 122, 224, 0.28); }

/* ── Dropdown de resultados ── */
.temp-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(108,122,224,0.3) transparent;
}
.temp-search-results:empty { display: none; }

.temp-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid transparent;
  background: white;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.temp-result-item:hover {
  background: rgba(108, 122, 224, 0.07);
  border-color: rgba(108, 122, 224, 0.2);
}
body.dark .temp-result-item {
  background: rgba(255,255,255,0.04);
}
body.dark .temp-result-item:hover {
  background: rgba(108, 122, 224, 0.12);
  border-color: rgba(108, 122, 224, 0.28);
}

.temp-result-img {
  width: 32px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(108,122,224,0.1);
}

.temp-result-info {
  flex: 1;
  min-width: 0;
}
.temp-result-nome {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #2d2f4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.dark .temp-result-nome { color: #e0e0f0; }

.temp-result-status {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #8b8fad;
  margin-top: 2px;
}

.temp-result-add {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6c7ae0, #a78bfa);
  border: none;
  color: white;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}
.temp-result-add:hover { opacity: 0.85; transform: scale(1.1); }
.temp-result-add:active { transform: scale(0.9); }

.temp-no-results {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  color: #aaa;
  text-align: center;
  padding: 12px;
}

/* ── Lista de temporadas associadas ── */
.temp-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.temp-lista:empty { display: none; }

.temp-label-section {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8b8fad;
  padding: 0 2px;
}

/* Card de temporada associada */
.temp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid rgba(108, 122, 224, 0.12);
  background: white;
  position: relative;
  animation: tempItemIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
body.dark .temp-item {
  background: rgba(255,255,255,0.04);
  border-color: rgba(108, 122, 224, 0.2);
}

@keyframes tempItemIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.temp-item-numero {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #6c7ae0 0%, #a78bfa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}

.temp-item-img {
  width: 28px;
  height: 40px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(108,122,224,0.1);
}

.temp-item-info {
  flex: 1;
  min-width: 0;
}
.temp-item-nome {
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #2d2f4a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.dark .temp-item-nome { color: #e0e0f0; }

.temp-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.temp-item-status {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #8b8fad;
}
.temp-item-eps {
  font-family: 'Nunito', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #b0b4d0;
}

.temp-item-remove {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 10px;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.temp-item-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  transform: scale(1.1);
}
.temp-item-remove:active { transform: scale(0.9); }

/* Anime pai (T1) — só exibe no card quando é subordinado */
.temp-item.temp-item--pai {
  border-color: rgba(108, 122, 224, 0.3);
  background: rgba(108, 122, 224, 0.05);
}

/* ─────────────────────────────────
   INDICADOR DE TEMPORADA NO CARD DA LISTA
   Pequena tag "T2", "T3"... no canto
   dos cards que são temporadas associadas
───────────────────────────────── */
.card-temp-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: linear-gradient(135deg, #6c7ae0, #a78bfa);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(108,122,224,0.4);
}

/* ── Aviso de anime já associado como temporada ── */
.temp-vinculado-aviso {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(108, 122, 224, 0.08);
  border: 1.5px solid rgba(108, 122, 224, 0.18);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #6c7ae0;
}
body.dark .temp-vinculado-aviso {
  background: rgba(108, 122, 224, 0.13);
  border-color: rgba(108, 122, 224, 0.28);
  color: #a78bfa;
}
.temp-vinculado-aviso svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* ── Toast de feedback ── */
.temp-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #2d2f4a;
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}
.temp-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
body.dark .temp-toast {
  background: #e0e0f0;
  color: #1e1f32;
}

/* ── Responsivo mobile ── */
@media (max-width: 768px) {
  .temp-header { padding: 11px 14px; }
  .temp-body-inner { padding: 12px 12px 14px; }
  .temp-search-input { font-size: 14px; } /* evita zoom no iOS */
}
