/* ============================================================
   GOES Satellite Viewer – Stylesheet
   Dark-theme weather tool aesthetic.  Designed for WordPress
   embedding via Custom HTML block or page template.
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0b0f14;
  --bg-panel:    #131920;
  --bg-card:     #1a2230;
  --bg-hover:    #212d3d;
  --border:      #2a3545;
  --text:        #cdd6e0;
  --text-dim:    #7f8c9b;
  --text-bright: #e8edf3;
  --accent:      #3b9dff;
  --accent-dim:  #1e5fa0;
  --warn:        #ff6b3d;
  --success:     #34d399;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius:      6px;
  --transition:  0.18s ease;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, select { font-family: inherit; }

/* ---------- Utility ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: 52px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}
.topbar-logo svg { flex-shrink: 0; }
.topbar-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.topbar-nav a {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}
.topbar-nav a:hover, .topbar-nav a.active {
  color: var(--text-bright);
  text-decoration: none;
}
.topbar-status {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}

/* ---------- Layout: sidebar + main ---------- */
.app-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 52px);
}
@media (max-width: 960px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; inset: 52px 0 0 0; z-index: 90; overflow-y: auto; }
  .mobile-toggle { display: flex !important; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding-bottom: 2rem;
}
.sidebar-section {
  padding: 1rem 1rem 0;
}
.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 1rem;
}
.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

/* Form controls */
.ctrl-group { margin-bottom: 0.75rem; }
.ctrl-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.ctrl-select, .ctrl-input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: var(--bg-card);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.ctrl-select:focus, .ctrl-input:focus {
  border-color: var(--accent);
}
.ctrl-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237f8c9b'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.6rem;
}
select option { background: var(--bg-card); color: var(--text-bright); }

/* Checkbox / toggle rows */
.overlay-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.82rem;
}
.overlay-toggle label { margin-bottom: 0; color: var(--text); cursor: pointer; }
.toggle-switch {
  position: relative;
  width: 34px; height: 18px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 9px;
  transition: background var(--transition);
  cursor: pointer;
}
.toggle-switch .slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 2px; top: 2px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle-switch input:checked + .slider { background: var(--accent-dim); }
.toggle-switch input:checked + .slider::before {
  transform: translateX(16px);
  background: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-bright);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn:hover { background: var(--bg-hover); border-color: var(--accent-dim); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #2b8ae6; }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

/* Playback controls row */
.playback-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.3rem;
}
.playback-row .btn { padding: 0.35rem 0.6rem; }

/* ---------- Main content ---------- */
.main-content {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Image viewport */
.viewer {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #000;
  min-height: 500px;
}
.viewer img {
  max-height: calc(100vh - 52px - 48px);
  object-fit: contain;
  user-select: none;
  transition: opacity 0.25s ease;
}
.viewer img.loading { opacity: 0.3; }
.viewer-placeholder {
  color: var(--text-dim);
  text-align: center;
  padding: 2rem;
}
.viewer-placeholder svg { margin-bottom: 0.8rem; }

/* Info bar under image */
.info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-dim);
  min-height: 48px;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.info-bar .info-label {
  color: var(--text-bright);
  font-weight: 600;
  margin-right: 0.3rem;
}

/* ---------- Mobile toggle ---------- */
.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.3rem;
}

/* ---------- Loading spinner ---------- */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Timestamp badge ---------- */
.timestamp-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--text);
  pointer-events: none;
}

/* ---------- Region grid (quick-pick) ---------- */
.region-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 0.4rem;
}
.region-chip {
  padding: 0.3rem 0.45rem;
  font-size: 0.72rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.region-chip:hover { background: var(--bg-hover); border-color: var(--accent-dim); }
.region-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Product pills ---------- */
.product-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.35rem;
}
.product-pill {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}
.product-pill:hover { background: var(--bg-hover); }
.product-pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   ABOUT / INFO PAGE
   ============================================================ */

.page-hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  background: linear-gradient(180deg, var(--bg-panel) 0%, var(--bg) 100%);
}
.page-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
}
.page-hero p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.65;
}

.content-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.content-section + .content-section {
  border-top: 1px solid var(--border);
}
.content-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 1rem;
}
.content-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin: 1.5rem 0 0.5rem;
}
.content-section p, .content-section li {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 0.6rem;
}
.content-section ul, .content-section ol {
  padding-left: 1.5rem;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.feature-card h3 {
  margin-top: 0;
  font-size: 1rem;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0;
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}
.feature-icon.sat  { background: #1a2d4a; color: #5dade2; }
.feature-icon.wx   { background: #2d1a1a; color: #ff6b3d; }
.feature-icon.data { background: #1a2d20; color: #34d399; }
.feature-icon.map  { background: #2d2a1a; color: #f0c040; }

/* Data table for product listing */
.product-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.88rem;
}
.product-table th, .product-table td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.product-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.product-table td { color: var(--text); }
.product-table tr:hover td { background: var(--bg-card); }

/* Signup / CTA form */
.cta-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.5rem;
  text-align: center;
  margin-top: 2rem;
}
.cta-box h2 { margin-bottom: 0.5rem; }
.cta-box p { max-width: 480px; margin: 0 auto 1.5rem; color: var(--text-dim); }
.cta-form {
  display: flex;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.cta-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.8rem;
  background: var(--bg);
  color: var(--text-bright);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
}
.cta-form input[type="email"]:focus { border-color: var(--accent); }

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 640px) {
  .page-hero h1 { font-size: 1.7rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .cta-form { flex-direction: column; }
}
