/* Visual polish: one icon style, softer cards, calmer labels, image-loading shimmer.
   Loaded before mobile.css so the phone layout can still override. */

/* Line icons that replace emoji in interface chrome (see js/ui/icons.js) */
.ui-icon { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 0.4em; flex: none; }
.ui-icon svg { width: 100%; height: 100%; }
.dash-icon { display: inline-flex; color: var(--accent); opacity: 0.9; }
.dash-icon .ui-icon { width: 20px; height: 20px; margin: 0; }
.settings-item .ui-icon { margin-right: 0.6em; color: var(--text-dim); }
.settings-item:hover .ui-icon { color: var(--accent); }
.section-title .ui-icon, .mlib-section-title .ui-icon { color: var(--accent); width: 1.05em; height: 1.05em; }
.media-btn .ui-icon { width: 1.05em; height: 1.05em; margin-right: 0.45em; }

/* Calmer labels: still small, but not everything shouts in capitals */
.dash-label { font-weight: 600; letter-spacing: 0.05em; }
.filter-group-label { text-transform: none; letter-spacing: 0.02em; font-size: 12.5px; }

/* Softer surfaces */
.dashboard-card, .season-block, .profile-header-card { border-color: var(--line-light); }
.dashboard-card { border-radius: var(--radius-lg); }
.poster-wrap { border-color: var(--line-light); }

/* Inline-styled quick cards (next up, continue playing) get the same radius as everything else */
.quick-card { background: var(--bg-raised); border: 1px solid var(--line-light); border-radius: var(--radius-md); padding: 10px; display: flex; gap: 10px; align-items: center; cursor: pointer; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, box-shadow 0.2s ease; }
.quick-card:hover { transform: translateY(-2px); border-color: var(--accent-dim); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25); }

/* Cards without a cover: a tinted gradient instead of a flat box */
.poster-placeholder { background: radial-gradient(120% 80% at 50% 0%, var(--accent-glow), transparent 62%), linear-gradient(135deg, var(--bg-raised) 0%, var(--bg-card) 100%); }

/* While a cover loads the frame shimmers (a few passes only, so long lists stay cheap) */
@media (prefers-reduced-motion: no-preference) {
  .poster-wrap {
    background-image: linear-gradient(110deg, var(--bg-raised) 30%, var(--bg-card) 50%, var(--bg-raised) 70%);
    background-size: 200% 100%;
    animation: posterShimmer 1.4s linear 6;
  }
}
@keyframes posterShimmer { to { background-position: -200% 0; } }

/* Press feedback on buttons */
.modal-btn:active, .mlib-toggle:active, .filter-clear:active, .profile-edit-btn:active { transform: scale(0.98); }

.tonight-hero-icon { display: inline-flex; color: var(--accent); }
.tonight-hero-icon .ui-icon { width: 34px; height: 34px; margin: 0; }
.roulette-btn-header .ui-icon { width: 20px; height: 20px; margin: 0; vertical-align: middle; }
.ui-label { display: inline-flex; align-items: center; }
@media (max-width: 768px) {
  .media-btn .ui-icon { display: block; width: 21px; height: 21px; margin: 0 auto 3px; }
}

/* Detail view: "My lists" and "My rating" share one grid, so labels and fields line up in every language */
.item-lists { display: grid; grid-template-columns: 10rem minmax(0, 220px); gap: 8px 10px; align-items: center; margin: 12px 0; }
.item-lists-label { font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.25; }
.item-lists-dd, .item-field-wrap { position: relative; min-width: 0; }
.item-field-wrap::after {
  content: ''; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; margin-top: -5px; pointer-events: none;
  border-right: 2px solid var(--text); border-bottom: 2px solid var(--text); transform: rotate(45deg);
}
.item-field, .item-lists-trigger {
  display: block; width: 100%; min-width: 0; max-width: none; height: 36px; margin: 0; box-sizing: border-box;
  padding: 0 32px 0 12px; font-family: inherit; font-size: 13.5px; font-weight: 700; line-height: 34px; letter-spacing: 0; color: var(--accent);
  text-align: left; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-sm);
  -webkit-appearance: none; appearance: none; background-image: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-lists-trigger::after { right: 13px; margin-top: -5px; }
.item-field:hover, .item-field:focus-visible { border-color: var(--accent); outline: none; }

.item-lists-label { text-align: left; }

/* Streaming providers: logo + brand tint, text always left-aligned */
.streaming-providers-row { align-items: stretch; text-align: left; }
.provider-pill {
  --brand: var(--text-dim);
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; text-align: left;
  border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border-radius: var(--radius-md);
}
.provider-logo { flex: none; width: 32px; height: 32px; border-radius: 8px; object-fit: cover; display: block; }
.provider-letter { display: inline-flex; align-items: center; justify-content: center; font-family: 'Bebas Neue', sans-serif; font-size: 20px; line-height: 1; color: #fff; background: var(--brand); }
.provider-text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; }
.provider-credit { flex: 1 0 100%; margin-top: 2px; font-size: 10.5px; color: var(--text-dim); text-align: left; }

/* Detail actions: tidy grid (category, watched toggles, remove) */
.detail-actions:has(#markAllWatchedBtn) {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; width: 100%; max-width: 420px; box-sizing: border-box;
}
.detail-actions:has(#markAllWatchedBtn) select.lang-select {
  grid-column: 1 / -1; max-width: none; width: 100%; height: 42px; text-align: left;
}
.detail-actions:has(#markAllWatchedBtn) .action-btn-secondary,
.detail-actions:has(#markAllWatchedBtn) .remove-btn-dynamic {
  height: auto; min-height: 42px; width: 100%; padding: 6px 10px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: normal; line-height: 1.15; text-align: center; min-width: 0; box-sizing: border-box;
  border-radius: 12px;
}
.detail-actions:has(#markAllWatchedBtn) #markAllWatchedBtn:hover {
  border-color: var(--watched, #22c55e); color: var(--watched, #22c55e);
}
.detail-actions:has(#markAllWatchedBtn) .remove-btn-dynamic {
  grid-column: 1 / -1; background: transparent; color: #fc8181;
  border: 1px solid rgba(229, 62, 62, 0.28); margin-top: 4px;
}
.detail-actions:has(#markAllWatchedBtn) .remove-btn-dynamic:hover { background: rgba(229, 62, 62, 0.14); color: #ff9b9b; }
@media (max-width: 380px) {
  .detail-actions:has(#markAllWatchedBtn) .action-btn-secondary { font-size: 12px; padding: 0 6px; gap: 5px; }
}

/* Feinschliff */
.item-notes-label { text-align: left; }
.profile-header-actions .profile-edit-btn {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; white-space: nowrap;
}
@media (max-width: 768px) {
  .profile-header-actions { width: 100%; }
  .profile-header-actions .profile-edit-btn { flex: 1 1 150px; max-width: 220px; white-space: normal; }
}
.poster-placeholder { color: var(--text-dim); border: 1px solid var(--line); }
:root[data-theme="light"] .poster-placeholder {
  background: linear-gradient(135deg, #e9e5d9 0%, #dcd7c8 100%); color: #5b574a; border-color: rgba(0,0,0,0.1);
}
@media (max-width: 360px) {
  .item-lists { grid-template-columns: minmax(5.5rem, 7rem) minmax(0, 1fr); gap: 8px; }
  .item-field, .item-lists-trigger { font-size: 12.5px; padding-left: 9px; padding-right: 28px; letter-spacing: 0; }
  .item-lists-label { font-size: 11px; }
}

/* Sync dialog: how-to */
.sync-how { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.03); text-align: left; }
.sync-how summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 700; color: var(--text); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sync-how summary::-webkit-details-marker { display: none; }
.sync-how summary::after { content: '▾'; color: var(--text-dim); transition: transform .15s ease; }
.sync-how[open] summary::after { transform: rotate(180deg); }
.sync-how ol { margin: 0; padding: 0 14px 12px 34px; display: grid; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--text-dim); }
.sync-how li::marker { color: var(--accent); font-weight: 800; }

.legal-updated { font-size: 12px; color: var(--text-dim); margin: -4px 0 14px; }

/* Buttons inside dialogs must not animate the inherited visibility of the opening dialog */
.modal-btn { transition: background-color .15s ease, color .15s ease, transform .15s ease, opacity .15s ease, border-color .15s ease; }

/* Import box on the empty start screen */
.import-promo{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px;padding:16px 18px;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line));border-radius:14px;background:color-mix(in srgb,var(--accent) 8%,var(--bg-raised))}
.import-promo-text{flex:1 1 240px;min-width:0}
.import-promo-title{font-weight:700;font-size:16px;color:var(--text);margin-bottom:2px}
.import-promo-sub{font-size:13px;color:var(--text-dim);line-height:1.4}
.import-promo-btn{flex:0 0 auto;min-height:44px;padding:0 18px;border:0;border-radius:10px;background:var(--accent-fill);color:#111;font-weight:700;font-size:14px;cursor:pointer}
@media (max-width:480px){.import-promo-btn{width:100%}}
/* WerStreamt.es badge and the remove button: darker text on the light theme (contrast) */
.badge-werstreamt{background:rgba(0,168,225,.15);color:#38bdf8;border-color:rgba(0,168,225,.4)}
@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]) .badge-werstreamt{color:#0369a1}
  :root:not([data-theme="dark"]) .detail-actions:has(#markAllWatchedBtn) .remove-btn-dynamic{color:#c53030}
}
:root[data-theme="light"] .badge-werstreamt{color:#0369a1}
:root[data-theme="light"] .detail-actions:has(#markAllWatchedBtn) .remove-btn-dynamic{color:#c53030}
.settings-item[hidden]{display:none!important}

/* Phones: the stat cards become one swipeable strip so the first covers/lists come into view sooner */
@media (max-width: 600px) {
  .dashboard-grid { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; padding-bottom: 2px; }
  .dashboard-grid::-webkit-scrollbar { display: none; }
  .dashboard-card { flex: 0 0 auto; min-width: 132px; padding: 8px 12px; }
  .dash-head { margin-bottom: 4px; gap: 10px; }
  .dash-label { font-size: 10px; }
  .dash-icon .ui-icon { width: 16px; height: 16px; }
  .dash-value { font-size: 22px; }
  .dash-sub { display: none; }
}
@media (max-width: 600px) {
  .tonight-hero-banner { padding: 12px 14px; margin-bottom: 14px; gap: 10px; }
  .tonight-hero-title { font-size: 20px; }
  .tonight-hero-icon { font-size: 24px; }
  .tonight-hero-sub { display: none; }
  .tonight-hero-btn { padding: 8px 14px; font-size: 13px; }
}
.filter-active-tag.filter-active-all{color:var(--text-dim);background:transparent;border-color:var(--line);font-weight:600}

/* Spoiler protection */
.ep-name-hidden{color:var(--text-dim);font-style:italic}
.spoiler-box{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:14px;border:1px dashed var(--line);border-radius:12px;background:var(--bg-card)}
.spoiler-box p{margin:0;color:var(--text-dim);font-size:13.5px;line-height:1.45}
.spoiler-reveal-btn{min-height:40px;padding:0 16px;border:0;border-radius:10px;background:var(--accent-fill);color:#111;font-weight:700;cursor:pointer}
/* "Since your last visit" banner */
.since-banner{display:flex;align-items:center;gap:12px;margin:0 0 14px;padding:10px 12px 10px 16px;border:1px solid color-mix(in srgb,var(--watched) 45%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--watched) 10%,var(--bg-raised))}
.since-banner-text{flex:1;min-width:0;font-size:14px;font-weight:600;color:var(--text);line-height:1.35}
.since-banner-btn{flex:0 0 auto;min-height:36px;padding:0 14px;border:0;border-radius:9px;background:var(--watched);color:#fff;font-weight:700;font-size:13px;cursor:pointer}
.since-banner-close{flex:0 0 auto;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--text-dim);cursor:pointer;font-size:14px}
.since-banner-close:hover{background:var(--line-light)}
@media (max-width:480px){.since-banner{flex-wrap:wrap}.since-banner-text{flex-basis:100%}.since-banner-btn{flex:1}}