/* ============================================================
   progress.css — progreso de episodios, avisos de episodios nuevos y botones de acción
   Theme pelismart. Se carga aparte de theme.css para no recompilar
   el bundle minificado (ver partials/header.ejs).
   ============================================================ */

:root {
   --prog-accent: #f5c518;
   --prog-ok: #f5c518;
   --prog-panel: #111;
   --prog-border: rgba(255, 255, 255, .16);
}

/* ---------- Botón "visto" en la lista de episodios ---------- */
/* .lnka es un overlay absoluto con z-index:1 (ver style.css), el botón va por encima */
.ep-watched-toggle {
   position: relative;
   z-index: 2;
   flex: 0 0 auto;
   margin-left: auto;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 4px;
   min-height: 28px;
   padding: 4px 10px;
   border-radius: 99px;
   border: 1px solid rgba(255, 255, 255, .28);
   background: rgba(255, 255, 255, .06);
   color: rgba(255, 255, 255, .82);
   font-family: inherit;
   font-size: 12px;
   font-weight: 600;
   line-height: 1;
   white-space: nowrap;
   cursor: pointer;
   transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ep-watched-toggle:hover {
   border-color: var(--prog-ok);
   color: var(--prog-ok);
   background: rgba(245, 197, 24, .12);
}

.episodios_list li.is-watched .ep-watched-toggle {
   background: var(--prog-ok);
   border-color: var(--prog-ok);
   color: #000;
}

@media (max-width: 480px) {
   .ep-watched-toggle {
      padding: 4px 8px;
      font-size: 11px;
   }
}

.episodios_list li.is-watched .ep-watched-toggle {
   background: var(--prog-ok);
   border-color: var(--prog-ok);
   color: #000;
}

.episodios_list li.is-watched .epi_desc > div {
   color: rgba(255, 255, 255, .55);
   text-decoration: line-through;
}

.episodios_list li.is-watched .epi_desc > small {
   opacity: .55;
}

/* ---------- Barra de progreso de la temporada ---------- */
.ep-season-progress {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 10px;
   margin: 0 0 12px;
   font-size: 13px;
   color: rgba(255, 255, 255, .7);
}

.ep-season-progress__bar {
   flex: 1 1 140px;
   height: 6px;
   min-width: 100px;
   border-radius: 99px;
   background: rgba(255, 255, 255, .12);
   overflow: hidden;
}

.ep-season-progress__fill {
   display: block;
   height: 100%;
   width: 0;
   border-radius: 99px;
   background: var(--prog-ok);
   transition: width .2s ease;
}

.follow-widget {
   position: relative;
   margin-top: 1rem;
   display: inline-block;
}

.ep-actions {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   margin-bottom: 1rem;
}

.season-watched-btn,
.ep-mark-btn {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 6px 12px;
   border-radius: 6px;
   border: 1px solid var(--prog-border);
   background: transparent;
   color: inherit;
   font-size: 13px;
   line-height: 1.2;
   cursor: pointer;
   transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.season-watched-btn:hover,
.ep-mark-btn:hover {
   border-color: var(--prog-accent);
   color: var(--prog-accent);
}

.ep-mark-btn.is-active {
   border-color: var(--prog-ok);
   color: var(--prog-ok);
}

/* Botón de avisos: mismo aspecto que los botones de listas (.watchlist-btn) */
.follow-btn {
   display: inline-flex;
   align-items: center;
   gap: .5rem;
   padding: .6rem 1.2rem;
   background: #1a1a1a;
   border: 1px solid #333;
   color: #ccc;
   border-radius: .4rem;
   font-size: .85rem;
   font-weight: 600;
   line-height: 1.2;
   cursor: pointer;
   transition: .2s;
}

.follow-btn:hover {
   border-color: #f5c518;
   color: #fff;
}

.follow-btn.is-active {
   background: #f5c518;
   border-color: #f5c518;
   color: #000;
}

.follow-btn.is-active:hover {
   color: #000;
   background: #ffd633;
   border-color: #ffd633;
}

.season-watched-btn[disabled],
.ep-mark-btn[disabled] {
   opacity: .55;
   cursor: default;
}

.ep-mark-btn {
   margin-top: 12px;
}

/* ---------- Barra de acciones bajo el reproductor (página de episodio) ---------- */
.ep-progress-actions {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 8px;
   margin: 12px 0 4px;
}

.ep-progress-actions .ep-mark-btn,
.ep-progress-actions .follow-btn {
   margin-top: 0;
}

/* En la barra, los dos botones comparten el aspecto de los botones de listas
   para que no queden de alturas distintas */
.ep-progress-actions .ep-mark-btn {
   padding: .6rem 1.2rem;
   border-radius: .4rem;
   border-color: #333;
   background: #1a1a1a;
   color: #ccc;
   font-size: .85rem;
   font-weight: 600;
}

.ep-progress-actions .ep-mark-btn:hover {
   border-color: #f5c518;
   color: #fff;
}

.ep-progress-actions .ep-mark-btn.is-active {
   background: #f5c518;
   border-color: #f5c518;
   color: #000;
}

/* ---------- Campanita del header ---------- */
.header__notif {
   position: relative;
   display: inline-flex;
   align-items: center;
}

/* El atributo [hidden] del HTML pierde frente a display:inline-flex,
   así que se fuerza aquí (el widget arranca oculto hasta saber si hay sesión) */
.header__notif[hidden],
.header__notif-count[hidden] {
   display: none !important;
}

.header__notif-btn {
   position: relative;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 36px;
   height: 36px;
   border: 0;
   border-radius: 50%;
   background: transparent;
   color: inherit;
   cursor: pointer;
}

.header__notif-btn:hover {
   background: rgba(255, 255, 255, .08);
}

.header__notif-count {
   position: absolute;
   top: 2px;
   right: 2px;
   min-width: 16px;
   height: 16px;
   padding: 0 4px;
   border-radius: 99px;
   background: #e5484d;
   color: #fff;
   font-size: 10px;
   font-weight: 700;
   line-height: 16px;
   text-align: center;
}

.header__notif-panel {
   position: absolute;
   top: calc(100% + 8px);
   right: 0;
   width: 320px;
   max-width: calc(100vw - 32px);
   background: var(--prog-panel);
   border: 1px solid var(--prog-border);
   border-radius: 10px;
   box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
   overflow: hidden;
   z-index: 1200;
}

.header__notif-head {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 8px;
   padding: 10px 12px;
   border-bottom: 1px solid var(--prog-border);
   font-size: 13px;
}

.header__notif-read {
   border: 0;
   background: transparent;
   color: var(--prog-accent);
   font-size: 12px;
   cursor: pointer;
}

.header__notif-list {
   max-height: 320px;
   overflow-y: auto;
}

.header__notif-item {
   display: flex;
   gap: 10px;
   padding: 10px 12px;
   border-bottom: 1px solid rgba(255, 255, 255, .06);
   text-decoration: none;
   color: inherit;
}

.header__notif-item:hover {
   background: rgba(255, 255, 255, .05);
}

.header__notif-item.is-unread {
   background: rgba(91, 140, 255, .1);
}

.header__notif-item img {
   width: 38px;
   height: 54px;
   object-fit: cover;
   border-radius: 4px;
   flex: 0 0 auto;
   background: rgba(255, 255, 255, .06);
}

.header__notif-item__body {
   display: flex;
   flex-direction: column;
   gap: 2px;
   min-width: 0;
}

.header__notif-item__title {
   font-size: 13px;
   font-weight: 600;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.header__notif-item__sub {
   font-size: 11px;
   color: rgba(255, 255, 255, .6);
}

.header__notif-empty {
   margin: 0;
   padding: 16px 12px;
   font-size: 13px;
   color: rgba(255, 255, 255, .6);
   text-align: center;
}

.header__notif-foot {
   display: block;
   padding: 10px 12px;
   border-top: 1px solid var(--prog-border);
   font-size: 12px;
   text-align: center;
   color: var(--prog-accent);
   text-decoration: none;
}

/* ---------- Perfil: continuar viendo ---------- */
.cw-card {
   display: flex;
   flex-direction: column;
   gap: 4px;
   height: 100%;
   padding: 6px;
   border-radius: 8px;
   background: rgba(255, 255, 255, .04);
   color: inherit;
   text-decoration: none;
}

.cw-card:hover {
   background: rgba(255, 255, 255, .08);
}

.cw-card__cover {
   position: relative;
   display: block;
   border-radius: 6px;
   overflow: hidden;
   aspect-ratio: 2 / 3;
   background: rgba(255, 255, 255, .05);
}

.cw-card__cover img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.cw-card__badge {
   position: absolute;
   left: 6px;
   bottom: 6px;
   padding: 2px 6px;
   border-radius: 4px;
   background: rgba(0, 0, 0, .72);
   color: #fff;
   font-size: 11px;
   font-weight: 600;
}

.cw-card__title {
   font-size: 13px;
   font-weight: 600;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.cw-card__sub {
   font-size: 11px;
   color: rgba(255, 255, 255, .6);
}

/* ---------- Perfil: lista de novedades ---------- */
.notif-badge {
   display: inline-block;
   min-width: 18px;
   height: 18px;
   padding: 0 5px;
   border-radius: 99px;
   background: #e5484d;
   color: #fff;
   font-size: 11px;
   font-weight: 700;
   line-height: 18px;
   text-align: center;
   vertical-align: middle;
}

.notif-list {
   display: flex;
   flex-direction: column;
   gap: 6px;
}

.notif-item {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 8px 10px;
   border-radius: 8px;
   background: rgba(255, 255, 255, .04);
   color: inherit;
   text-decoration: none;
}

.notif-item.is-unread {
   background: rgba(91, 140, 255, .12);
}

.notif-item:hover {
   background: rgba(255, 255, 255, .08);
}

.notif-item__img {
   width: 34px;
   height: 48px;
   object-fit: cover;
   border-radius: 4px;
   flex: 0 0 auto;
   background: rgba(255, 255, 255, .06);
}

.notif-item__body {
   display: flex;
   flex-direction: column;
   gap: 2px;
   min-width: 0;
   flex: 1 1 auto;
}

.notif-item__title {
   font-size: 14px;
   font-weight: 600;
}

.notif-item__sub {
   font-size: 12px;
   color: rgba(255, 255, 255, .65);
}

.notif-item__date {
   font-size: 11px;
   color: rgba(255, 255, 255, .5);
   flex: 0 0 auto;
}

.btn-secondary {
   padding: 6px 12px;
   border-radius: 6px;
   border: 1px solid var(--prog-border);
   background: transparent;
   color: inherit;
   font-size: 13px;
   cursor: pointer;
}

.btn-secondary:hover {
   border-color: var(--prog-accent);
   color: var(--prog-accent);
}

/* ============================================================
   Ajustes del theme dooplay
   En este theme la lista de episodios es ul.episodios dentro de
   .se-a[data-season-panel] y cada fila es flex (numerando + título),
   así que el botón de "visto" se pega a la derecha con margin-left:auto.
   ============================================================ */
:root {
   --prog-accent: #408bea;
   --prog-ok: #22c55e;
   --prog-panel: #1a1a1a;
   --prog-border: rgba(255, 255, 255, .16);
}

/* ---------- Fila de episodio ---------- */
#seasons .se-c .se-a ul.episodios li .ep-watched-toggle {
   margin-left: auto;
   margin-right: 10px;
}

#seasons .se-c .se-a ul.episodios li.is-watched .episodiotitle a {
   color: rgba(255, 255, 255, .55);
   text-decoration: line-through;
}

#seasons .se-c .se-a ul.episodios li.is-watched .numerando {
   color: var(--prog-ok);
}

/* La barra de progreso vive dentro de .se-a, que recorta con overflow:hidden */
.se-a .ep-season-progress {
   margin: 8px 10px 10px;
}

/* ---------- Botones con el azul de dooplay ---------- */
.follow-btn:hover,
.ep-progress-actions .ep-mark-btn:hover,
.season-watched-btn:hover {
   border-color: var(--prog-accent);
   color: #fff;
}

.follow-btn.is-active,
.follow-btn.is-active:hover,
.ep-progress-actions .ep-mark-btn.is-active,
.ep-mark-btn.is-active {
   background: var(--prog-accent);
   border-color: var(--prog-accent);
   color: #fff;
}

/* ---------- Campanita dentro del header de dooplay ---------- */
#dt-nav .header__notif {
   color: #fff;
}

#dt-nav .header__notif-panel {
   z-index: 3000;
}

/* ---------- Perfil: rejilla de "continuar viendo" ---------- */
.cw-grid {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: .75rem;
}

@media (min-width: 640px) {
   .cw-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Perfil: bloque de novedades ---------- */
.section-head {
   display: flex;
   align-items: center;
   justify-content: space-between;
   flex-wrap: wrap;
   gap: .5rem;
   margin-bottom: 1rem;
}

.section-head .section-title {
   margin: 0;
}

@media (max-width: 767px) {
   .header__notif-panel {
      position: fixed;
      top: 64px;
      left: 12px;
      right: 12px;
      width: auto;
   }
}
