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

:root {
  --red-dark: #8B0000;
  --red: #CC0000;
  --red-bright: #FF1111;
  --dark: #111111;
  --dark2: #1a1a1a;
  --dark3: #222222;
  --gray: #888;
  --white: #ffffff;
}

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

html, body {
  font-family: 'Roboto', sans-serif;
  background: var(--dark);
  color: var(--white);
  min-height: 100vh;
}

/* ─── HEADER ─────────────────────────────────────────── */
.header {
  background: #000;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(204,0,0,0.4);
}

.header-banner {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0000 50%, #0a0a0a 100%);
  border-bottom: 2px solid var(--red);
}

.app-title {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.app-title span { color: var(--red-bright); }

.anila-logo { height: 38px; object-fit: contain; }

/* ─── PRIVACY BANNER ─────────────────────────────────── */
.privacy-banner {
  background: linear-gradient(135deg, #1a0000, #2a0000);
  border-bottom: 1px solid var(--red-dark);
  padding: 10px 16px;
  text-align: center;
  display: none;
}
.privacy-banner.visible { display: block; }
.privacy-banner p { font-size: 12px; color: #ccc; margin-bottom: 8px; line-height: 1.5; }
.privacy-banner strong { color: var(--red-bright); }

.btn-privacy {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 4px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  text-transform: uppercase;
}
.btn-privacy:hover { background: linear-gradient(135deg, #ee0000, var(--red)); }

/* ─── INSTALL BANNER PWA ─────────────────────────────── */
.install-banner {
  display: none;            /* hidden by default, shown by JS */
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0a2a0a, #0d3d0d);
  border-bottom: 2px solid #2a7a2a;
  position: relative;
  z-index: 90;
}
.install-banner.show { display: flex; }

.install-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-banner-text strong {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}
.install-banner-text span {
  font-size: 12px;
  color: #aed6a0;
  line-height: 1.3;
}
.install-banner-text b { color: #fff; }

.install-btn-yes {
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}
.install-btn-yes:hover { background: #388e3c; }

.install-btn-no {
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
}
.install-btn-no:hover { color: #fff; }

/* iOS variant: slightly different instruction text style */
.install-banner-ios .install-banner-text span { color: #b0d4ff; }
.install-banner-ios { background: linear-gradient(135deg, #0a1a2a, #0d2a3d); border-color: #2a5a7a; }


.nav-tabs {
  display: flex;
  background: var(--dark2);
  border-bottom: 2px solid var(--red-dark);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 0 0 auto;
  padding: 10px 16px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--gray);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-transform: uppercase;
}
.nav-tab:hover { color: var(--white); background: rgba(204,0,0,0.1); }
.nav-tab.active {
  color: var(--white);
  border-bottom-color: var(--red-bright);
  background: rgba(204,0,0,0.15);
}

/* ─── PAGES ──────────────────────────────────────────── */
.page { display: none; padding: 16px; }
.page.active { display: block; }

/* ─── BUTTON GRID ────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding: 8px 0;
}

.btn-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(145deg, var(--dark3), #2d0000);
  border: 1px solid rgba(204,0,0,0.3);
  border-radius: 10px;
  padding: 14px 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--white);
  transition: all 0.2s ease;
  text-align: center;
  min-height: 100px;
}
.btn-grid:hover {
  background: linear-gradient(145deg, #2d0000, #400000);
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(204,0,0,0.3);
}
.btn-grid:active { transform: translateY(0); box-shadow: none; }
.btn-grid img { width: 60px; height: 60px; object-fit: contain; border-radius: 50%; }
.btn-grid span {
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ddd;
  line-height: 1.3;
}

/* ─── SECTION HEADER ─────────────────────────────────── */
.section-header {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 0 8px;
  border-bottom: 2px solid var(--red-dark);
  margin-bottom: 16px;
}
.section-header::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--red-bright);
  margin-right: 10px;
  vertical-align: middle;
}

/* ─── SUBSECTION ─────────────────────────────────────── */
.subsection { margin-bottom: 24px; }
.subsection-title {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(204,0,0,0.3);
}

/* ─── INFO BOX ───────────────────────────────────────── */
.info-box {
  background: linear-gradient(135deg, var(--dark3), #200000);
  border: 1px solid rgba(204,0,0,0.3);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 14px;
  color: #ddd;
}
.info-box h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: 1px;
}


/* ─── IFRAME OVERLAY ─────────────────────────────────── */
.iframe-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  background: #fff;
}
.iframe-container.visible { display: flex; }

.iframe-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #0a0a0a, #1a0000);
  border-bottom: 2px solid var(--red-dark);
  min-height: 46px;
  flex-shrink: 0;
}

.iframe-title {
  flex: 1;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 1px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-back {
  background: var(--red-dark);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-back:hover { background: var(--red); }

.btn-open-tab {
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.2);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.btn-open-tab:hover { background: rgba(255,255,255,0.2); color: #fff; }

.iframe-body {
  flex: 1;
  border: none;
  width: 100%;
  background: #fff;
  display: block;
}

/* Messaggio pagina bloccata */
.iframe-blocked {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}
.iframe-blocked-inner {
  text-align: center;
  padding: 32px 24px;
  max-width: 320px;
}
.iframe-blocked-icon { font-size: 48px; margin-bottom: 16px; }
.iframe-blocked-inner p {
  font-size: 15px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ─── ANILA CARD ─────────────────────────────────────── */
.anila-card {
  background: linear-gradient(135deg, #0a0000, #1a0000);
  border: 1px solid rgba(204,0,0,0.4);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #ccc;
  line-height: 1.6;
}
.anila-card strong { color: var(--red-bright); }
.anila-card h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  color: var(--white);
  margin-bottom: 10px;
  letter-spacing: 1px;
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn-red {
  display: inline-block;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  margin: 4px;
}
.btn-red:hover {
  background: linear-gradient(135deg, #ee0000, var(--red));
  box-shadow: 0 3px 10px rgba(204,0,0,0.4);
}

/* ─── CONTACTS ───────────────────────────────────────── */
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  color: #ccc;
}
.contact-row a { color: var(--red-bright); text-decoration: none; cursor: pointer; }
.contact-row a:hover { text-decoration: underline; }
.contact-label { color: var(--gray); font-size: 12px; min-width: 60px; }

/* ─── CONTACT CTA BUTTONS ────────────────────────────── */
.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0;
}

.contact-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.contact-cta:active { transform: scale(0.97); }

.contact-cta-whatsapp {
  background: linear-gradient(135deg, #075e54, #128c7e);
  box-shadow: 0 3px 12px rgba(7,94,84,0.4);
}
.contact-cta-whatsapp:hover { box-shadow: 0 5px 18px rgba(7,94,84,0.6); }

.contact-cta-youtube {
  background: linear-gradient(135deg, #900, #cc0000);
  box-shadow: 0 3px 12px rgba(180,0,0,0.4);
}
.contact-cta-youtube:hover { box-shadow: 0 5px 18px rgba(180,0,0,0.6); }

.contact-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  color: #fff;
}

.contact-cta-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.contact-cta-text strong {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}
.contact-cta-text small {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}

/* ─── BOTTOM NAV ─────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, #0d0000 0%, #000 100%);
  border-top: 2px solid var(--red-dark);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 99;
}

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background 0.2s;
  background: none;
  border: none;
  color: var(--gray);
  min-width: 60px;
}
.bottom-nav-btn:hover,
.bottom-nav-btn.active { background: rgba(204,0,0,0.2); color: var(--white); }
.bottom-nav-btn img { width: 28px; height: 28px; object-fit: contain; border-radius: 50%; opacity: 0.7; }
.bottom-nav-btn.active img { opacity: 1; }
.bottom-nav-btn span {
  font-size: 9px;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.content-wrapper { padding-bottom: 70px; }

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 360px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (min-width: 768px) {
  .header-top { padding: 8px 24px; }
  .app-title { font-size: 26px; }
  .page { padding: 20px 24px; }
  .bottom-nav { display: none; }
}

@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
}


/* ═══════════════════════════════════════════════════════
   HEADER CANALE
═══════════════════════════════════════════════════════ */
.yt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--dark2);
}

.yt-logo {
  flex-shrink: 0;
  width: 36px; height: 36px;
}
.yt-logo svg { width: 36px; height: 36px; }

.yt-channel-info { flex: 1; min-width: 0; }
.yt-channel-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yt-channel-handle {
  font-size: 12px;
  color: var(--gray);
  margin-top: 2px;
}

.yt-refresh-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--gray);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 16px;
}
.yt-refresh-btn:hover { border-color: var(--red); color: var(--white); }
.yt-refresh-btn.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   STATO CARICAMENTO / ERRORE
═══════════════════════════════════════════════════════ */
.yt-status {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.yt-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.yt-error-icon { font-size: 36px; }
.yt-retry-btn {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}
.yt-retry-btn:hover { background: var(--red2); }

/* ═══════════════════════════════════════════════════════
   LISTA VIDEO
═══════════════════════════════════════════════════════ */
.yt-list {
  display: flex;
  flex-direction: column;
}

.yt-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.yt-item:last-child { border-bottom: none; }
.yt-item:hover, .yt-item:active { background: var(--dark3); }

/* Thumbnail */
.yt-thumb {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--dark3);
  aspect-ratio: 16/9;
}
.yt-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.yt-item:hover .yt-thumb img { transform: scale(1.04); }

.yt-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.2s;
}
.yt-item:hover .yt-play-overlay { opacity: 1; }
.yt-play-circle {
  width: 32px; height: 32px;
  background: rgba(200,0,0,0.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.yt-play-circle svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }

/* Badge "NUOVO" sul primo video */
.yt-new-badge {
  position: absolute;
  top: 5px; left: 5px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Info testo */
.yt-info { flex: 1; min-width: 0; }

.yt-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--white);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.yt-meta {
  font-size: 11px;
  color: var(--gray);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.yt-date { display: flex; align-items: center; gap: 4px; }

.yt-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 12px;
  background: var(--red);
  color: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.yt-open-btn:hover { background: var(--red2); }

/* Footer */
.yt-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--dark2);
  text-align: center;
}
.yt-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--red);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.yt-footer a:hover { color: var(--red2); }
.yt-last-update {
  font-size: 10px;
  color: var(--gray);
  margin-top: 6px;
}
