/* ===================================================
   SCS Archive — Design System
   Aligned with sonocoseserie.it main site
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

:root {
  /* Background */
  --bg-color: #222222;
  --panel-bg: #2a2a2a;
  --panel-bg-hover: #313131;

  /* Borders */
  --border-color: #303030;
  --border-accent: #ff580c;
  --border-silver: #C0C0C0;

  /* Text */
  --text-main: #ffffff;
  --text-muted: #b7b7b7;
  --text-light: #999999;

  /* Accent */
  --accent: #ff580c;
  --accent-hover: #e84e08;

  /* Topic type colors */
  --type-recensione: #ff580c;
  --type-news: #3b82f6;
  --type-wip: #eab308;
  --type-editoriale: #FF0000;
  --type-originals: #10b981;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
}

/* ---- Reset ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Body ---- */
body {
  font-family: 'Ubuntu', 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Layout ---- */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ---- Panels ---- */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease;
}

/* ---- Header with background image ---- */
.glass-header {
  text-align: left;
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  background: 
    linear-gradient(to right, rgba(34, 34, 34, 0.92), rgba(34, 34, 34, 0.75)),
    url('img/background_2020.jpg') center/cover no-repeat;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-logo {
  width: 76px;
  height: 76px;
  border-radius: 0;
  flex-shrink: 0;
}

.glass-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
  color: var(--text-main);
  position: relative;
  display: inline-block;
}

.glass-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: 3rem;
  padding: 2rem;
  background:
    linear-gradient(to right, rgba(34, 34, 34, 0.92), rgba(34, 34, 34, 0.78)),
    url('img/background_2020.jpg') center bottom/cover no-repeat;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  opacity: 0.9;
}

.footer-brand span {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-main);
}

.footer-text {
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 300;
}

.footer-text a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-text a:hover {
  color: var(--text-main);
}

/* ---- Controls / Filters ---- */
.controls {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.search-bar input[type="text"] {
  width: 100%;
}

input[type="text"], select {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 300;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}

select option {
  background-color: var(--bg-color);
  color: var(--text-main);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b7b7b7' d='M6 8.4L1.2 3.6h9.6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 88, 12, 0.15);
}

input[type="text"]::placeholder {
  color: var(--text-light);
  font-weight: 300;
}

/* ---- Buttons ---- */
.btn {
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.25s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-main);
  background: var(--bg-color);
}

.btn:hover {
  border-color: var(--border-silver);
  background: var(--panel-bg-hover);
  transform: translateY(-1px);
}

/* Primary button — orange */
.primary-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
}
.primary-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 88, 12, 0.3);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* ---- Topics Grid ---- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.topic-card {
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* ---- Badge / Pill ---- */
.badge {
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.type-recensione { background-color: var(--type-recensione); }
.type-news { background-color: var(--type-news); }
.type-wip { background-color: var(--type-wip); }
.type-editoriale { background-color: var(--type-editoriale); }
.type-originals { background-color: var(--type-originals); }
.type-product { background-color: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; }
.type- { background-color: #64748b; }

.episode-code {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Ubuntu Mono', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2em 0.6em;
  border-radius: var(--radius-sm);
}

.topic-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.35;
  color: var(--text-main);
}

.synopsis {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  flex-grow: 1;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ---- Scores ---- */
.scores {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.score {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  min-width: 64px;
  text-align: center;
}

.score-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.score-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.score-max {
  font-size: 0.75rem;
  opacity: 0.4;
  margin-left: 1px;
  font-weight: 300;
}

.score-segments {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  width: 100%;
  justify-content: center;
}

.score-segment {
  height: 3px;
  width: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.score-segment.filled {
  background: #a6a6a6;
}

.score-segment.half::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: #a6a6a6;
}

/* ---- Tags ---- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: var(--panel-bg);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.tag:hover {
  border-color: var(--border-silver);
  color: var(--text-main);
}

/* ---- Pagination ---- */
.pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
}

.page-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 300;
}

/* ---- No Results ---- */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.no-results h3 {
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-weight: 700;
}

/* ---- Loading spinner ---- */
.loading {
  text-align: center;
  padding: 4rem;
  color: var(--text-muted);
  font-weight: 300;
}
.loading::after {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  margin: 1rem auto;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ==============================================================
   Detail Page
   ============================================================== */

.detail-page .glass-header {
  padding: 2rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.back-btn {
  margin-bottom: 1.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  font-weight: 400;
}
.back-btn:hover {
  background: var(--panel-bg-hover);
  border-color: var(--accent);
  transform: translateX(-4px);
}

.title-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.main-title {
  font-size: 2.2rem;
  font-weight: 700;
}

.content-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.text-content {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.text-content h3, .meta-panel h3, .links-panel h3 {
  margin-bottom: 1.2rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}

.links-panel h3 {
  margin: 1.5rem 1.5rem 1.2rem 1.5rem;
}


.text-content p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1rem;
  font-weight: 300;
}

.text-content.highlight {
  background: rgba(255, 255, 255, 0.03);
}

/* ---- Meta / Links panels ---- */
.meta-panel {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}



.links-panel {
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
}



.links-thumb {
  aspect-ratio: 16 / 9;
  width: 90%;
  margin: 1.5rem auto 0 auto;
  background-size: cover;
  background-position: center;
  background-color: var(--panel-bg);
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.links-thumb .header-overlay {
  display: none; /* Rimosso overlay testo per evitare sovrapposizioni */
}

.links-panel .external-links {
  padding: 1.5rem;
}

.big-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.big-scores .score {
  align-items: center;
  padding: 1rem;
  border-radius: var(--radius-md);
}
.big-scores .score-val {
  font-size: 2.2rem;
}

.big-scores .score-max {
  font-size: 1rem;
  margin-left: 2px;
}

.big-scores .score-segments {
  margin-top: 8px;
  gap: 5px;
}

.big-scores .score-segment {
  height: 5px;
  width: 24px;
}

/* ---- External Links (pill style, SCS main site) ---- */
.external-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem 0.5rem 0.5rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
}

.links-description {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-weight: 500;
  padding: 0;
}

.links-description strong {
  color: var(--accent);
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.link-btn:hover {
  border-color: var(--border-silver);
  transform: translateX(4px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.link-btn .link-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.link-btn:hover .link-icon {
  transform: scale(1.1);
}

.link-btn .link-icon svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

.link-btn.spotify .link-icon  { background: #1DB954; }
.link-btn.apple .link-icon    { background: #ab47bc; }
.link-btn.youtube .link-icon  { background: #FF0000; }
.link-btn.gdrive .link-icon   { background: #4285F4; }


/* ==============================================================
   Episodes Table (embedded in episodes pages)
   ============================================================== */

.ep-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  align-items: flex-end;
}
.ep-filters select {
  width: auto;
  min-width: 150px;
  padding: 0.6rem 1rem;
}
.ep-filters .btn {
  padding: 0.6rem 1.2rem;
}
.filter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.filter-group {
  display: flex;
  flex-direction: column;
}

.episodes-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-main);
}
.episodes-table th, .episodes-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.episodes-table th {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.episodes-table tr {
  transition: background 0.15s ease;
}
.episodes-table tr:hover td {
  background-color: rgba(255, 88, 12, 0.04);
}

/* ---- Status badges ---- */
.status-badge {
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 300;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}
.status-empty {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

/* ---- Link Indicators ---- */
.link-indicators { display: flex; gap: 0.4rem; }
.link-ind {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 0.65rem; font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.15s ease;
  text-transform: uppercase;
}
.link-ind:hover { transform: scale(1.15); }
.link-ind.ok {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}
.link-ind.nf {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
  opacity: 0.7;
}
.link-ind.missing {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.2);
  border-style: dashed;
}

/* ---- Action Button ---- */
.action-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
}
.action-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(255, 88, 12, 0.25);
}
.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


.filter-toggle-btn {
  background: transparent;
  border-color: var(--border-color);
}

.filter-toggle-btn.active {
  background: rgba(255, 88, 12, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 0;
}

.filters.show {
  max-height: 200px;
  opacity: 1;
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==============================================================
   Sidebar Rankings
   ============================================================== */
.main-content-wrapper {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.main-column {
  flex: 1;
  min-width: 0; 
}

.sidebar-column {
  width: 320px;
  flex-shrink: 0;
}

.sidebar-sticky-wrapper {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.015);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ranking-box {
  --box-color: var(--accent); /* Default fallback */
  padding: 1.5rem;
  background: color-mix(in srgb, var(--box-color) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--box-color) 20%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--box-color) 5%, transparent);
}

.lucky-box { --box-color: #eab308; } /* Yellow/Gold */
.box-top5 { --box-color: #10b981; }  /* Emerald Green */
.box-flop5 { --box-color: #ef4444; } /* Red */
.box-mtop { --box-color: #a855f7; }  /* Purple */
.box-mflop { --box-color: #3b82f6; } /* Blue */


.ranking-box h3 {
  font-size: 1rem;
  color: var(--box-color);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.ranking-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
}

.ranking-item:hover {
  background: color-mix(in srgb, var(--box-color) 12%, transparent);
  border-color: var(--box-color);
  transform: translateX(-2px);
}

.ranking-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.ranking-item-score {
  font-weight: 700;
  color: var(--box-color);
}

.lucky-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
}

.lucky-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
  .main-content-wrapper {
    flex-direction: column;
  }
  .sidebar-column {
    width: 100%;
  }
  .sidebar-sticky-wrapper {
    position: static;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }

  .glass-header {
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    position: relative;
    text-align: left;
  }

  .header-brand {
    gap: 0.75rem;
    justify-content: flex-start;
    padding-right: 80px; /* Spazio per il tasto login a dx */
  }

  .header-logo {
    width: 44px;
    height: 44px;
  }

  .glass-header h1 {
    font-size: 1.15rem; /* Molto più piccolo per stare su una riga */
    line-height: 1.2;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .glass-header p {
    display: block; /* Ripristinato sottotitolo */
    font-size: 0.7rem;
    margin-top: 0.1rem;
    color: var(--text-muted);
  }

  /* Login in alto a destra */
  .header-content nav, .header-nav {
    position: absolute;
    top: -0.2rem;
    right: 0;
    gap: 0.4rem;
  }

  .header-content nav .btn, .header-nav .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
    min-width: 0;
  }

  /* Barra di ricerca su una sola riga */
  .search-bar {
    flex-direction: row;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }

  .search-input-wrapper {
    flex: 1;
    min-width: 0;
  }

  input[type="text"], select {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .btn.filter-toggle-btn, .search-bar .primary-btn {
    padding: 0.5rem 0.6rem;
    flex-shrink: 0;
  }

  .search-bar .primary-btn {
    font-size: 0.7rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .main-title {
    font-size: 1.5rem;
  }

  .ep-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  .nav-text {
    display: none; /* Nasconde testo paginazione su mobile */
  }

  .hide-mobile {
    display: none !important;
  }

  /* Rendi le tabelle scrollabili orizzontalmente se necessario */
  main.glass-panel {
    overflow-x: auto;
    padding: 1rem !important;
  }

  .episodes-table {
    min-width: 450px; /* Garantisce leggibilità minima */
  }

  .episodes-table th, .episodes-table td {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* ==============================================================
   Auth — User Badge & Logout (area protetta)
   ============================================================== */

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 88, 12, 0.08);
  border: 1px solid rgba(255, 88, 12, 0.25);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.9rem 0.35rem 0.6rem;
  transition: border-color 0.2s ease;
}

.user-badge:hover {
  border-color: rgba(255, 88, 12, 0.5);
}

.user-icon {
  font-size: 1rem;
  line-height: 1;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid rgba(255, 88, 12, 0.4);
  color: var(--accent);
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: none;
  box-shadow: 0 2px 8px rgba(255, 88, 12, 0.3);
}

