/* ───────────────────────────────────────────────────────────────
   chrome.css — shared header / nav / ticker chrome for standalone
   tool pages, so they match the root (home) page on web and mobile.
   Owns the theme variable system (dark default + light).
   ─────────────────────────────────────────────────────────────── */

:root {
  --bg:   #0a0a0a; --bg2:  #111111; --bg3:  #0d0d0d; --bg4:  #161616;
  --bd:   #1e1e1e; --bd2:  #2a2a2a;
  --t1:   #e5e5e5; --t2:   #999999; --t3:   #666666; --t4:   #444444;
  --accent: #FFE600;
  --sep-color: #1a1a1a;
  /* flip-clock theme colors (layout vars stay per-page) */
  --card-top: #1e1e1e; --card-bot: #181818; --card-sep-color: #0a0a0a;
  --flip-top-color: #f0f0f0; --flip-bot-color: #d8d8d8;
  --shadow-flip: 0 6px 28px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.04);
}

[data-theme="light"] {
  --bg:   #f2f2f7; --bg2:  #ffffff; --bg3:  #f9f9f9; --bg4:  #ececec;
  --bd:   #e5e5ea; --bd2:  #d1d1d6;
  --t1:   #1c1c1e; --t2:   #636366; --t3:   #8e8e93; --t4:   #aeaeb2;
  --accent: #FFE600;
  --sep-color: #e5e5ea;
  --card-top: #f0f0f5; --card-bot: #e8e8ed; --card-sep-color: #d1d1d6;
  --flip-top-color: #1c1c1e; --flip-bot-color: #3a3a3c;
  --shadow-flip: 0 4px 16px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.7);
}

/* ── Fact ticker (mirrors the home band) ───────────────────────── */
#ticker-wrap {
  width: 100%;
  height: 32px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #1c1a00;
  position: relative;
  flex-shrink: 0;
}
#ticker-content-el {
  position: absolute;
  white-space: nowrap;
  color: #FFE600;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  will-change: transform;
  animation: ticker-scroll 360s -60s linear infinite;
}
@keyframes ticker-scroll {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}
/* Acessibilidade: respeita "movimento reduzido" do sistema operacional
   — desacelera muito o ticker em vez de rolar continuamente. */
@media (prefers-reduced-motion: reduce) {
  #ticker-content-el { animation-duration: 1080s; }
}
/* Acessibilidade: link "pular para o conteúdo" (visível só ao focar via teclado) */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: #FFE600; color: #000; padding: 10px 16px; font-weight: 600; text-decoration: none; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
/* Ambient depth (dark only): subtle warm glow + faint grain behind content */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 75% 55% at 50% -10%, rgba(255,205,90,0.06), transparent 62%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] body::before, [data-theme="light"] body::after { display: none; }

/* ── Top ad banner (mirrors home: 728×90 desktop, 320×50 mobile) ──
   No fixed height/background: empty slots collapse until AdSense fills them. */
#ad-top {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
#ad-mobile-top { display: none; }
@media (max-width: 560px) {
  #ad-top { display: none; }
  #ad-mobile-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
  }
}
body.fs-mode #ad-top, body.fs-mode #ad-mobile-top { display: none !important; }

/* Collapse any ad slot AdSense couldn't fill (keeps the ad code in place for
   review; the unit reappears automatically once it serves an ad). */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ── Site header (logo + theme switch + lang + timezone chip) ───── */
.site-header {
  width: 100%;
  max-width: 760px;
  margin: 20px auto 4px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.site-header .logo {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t1);
  text-decoration: none;
}
.site-header .logo span { color: #FFE600; }

#theme-switcher {
  display: inline-flex;
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.theme-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 6px;
  opacity: 0.5;
  transition: background 0.15s, opacity 0.15s;
}
.theme-btn.active {
  opacity: 1;
  background: var(--bg4);
}

#lang-select {
  background: var(--bg3);
  border: 1px solid var(--bd);
  color: var(--t2);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: auto;
}
#lang-select:hover { border-color: #FFE600; }

.tz-chip {
  background: var(--bg3);
  border: 1px solid var(--bd);
  color: var(--t2);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* ── YouTube icon link (injected before tz-chip by chrome.js) ──── */
.yt-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--t3); text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.yt-icon:hover { color: #FF0000; background: var(--bg3); transform: scale(1.06); }
.yt-icon svg { width: 20px; height: 20px; display: block; }

/* ── Primary nav with underline-active tabs (mirrors home) ─────── */
#main-nav {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 6px;
  padding: 0 24px;
}
#main-nav .nav-row {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--sep-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#main-nav .nav-row::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--t2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--t1); text-decoration: none; }
.tab-btn.active {
  color: var(--t1);
  border-bottom: 2px solid #FFE600;
}
.tab-btn-tools {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--t2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
  cursor: pointer;
}
.tab-btn-tools:hover,
.tab-btn-tools[aria-expanded="true"] { color: var(--t1); }
.tab-btn-tools.active {
  color: var(--t1);
  border-bottom: 2px solid #FFE600;
}
.tools-caret { font-size: 9px; line-height: 1; transition: transform 0.2s ease; }
.tab-btn-tools[aria-expanded="true"] .tools-caret { transform: rotate(180deg); }
.tools-icon { width: 17px; height: 17px; display: block; flex-shrink: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.tools-menu {
  position: fixed;
  z-index: 1000;
  min-width: 190px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tools-menu[hidden] { display: none; }
.tools-menu a {
  display: block;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 14px;
  color: var(--t2);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.tools-menu a:hover { background: rgba(255,255,255,0.05); color: var(--t1); }

@media (max-width: 480px) {
  .site-header { padding: 0 14px; margin-top: 14px; }
  #main-nav { padding: 0 14px; }
  .site-header .logo { font-size: 16px; }
  /* Chip de fuso oculto no mobile (igual à home) */
  .tz-chip { display: none; }
}

/* Mobile nav: quebra em 2 linhas (3 abas por linha) igual à home,
   para que tudo — incluindo a barra amarela da aba ativa — fique visível
   sem rolagem horizontal. Ícone de ferramentas vai para a 3ª linha. */
@media (max-width: 560px) {
  #main-nav .nav-row {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .nav-row .tab-btn {
    flex: 1 1 33%;
    min-width: 0;
    padding: 10px 6px;
    font-size: 11.5px;
    text-align: center;
    justify-content: center;
    min-height: 40px;
  }
  .nav-row .tab-btn:nth-child(-n+3) {
    border-bottom: 1px solid var(--sep-color);
  }
  .nav-row .tab-btn.active,
  .nav-row .tab-btn-tools.active {
    border-bottom: 2px solid #FFE600;
    color: var(--t1);
  }
}
