/* StreamHub — Global Styles (Elder-Friendly Dark Theme) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Kannada:wght@400;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #12121e;
  --bg-card: #1a1a2e;
  --bg-card-hover: #242440;
  --bg-input: #1e1e32;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6a6a80;
  --accent: #6c5ce7;
  --accent-hover: #7f70f0;
  --green: #00b894;
  --red: #ff6b6b;
  --amber: #fdcb6e;
  --blue: #74b9ff;
  --border: #2a2a40;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --font-kn: 'Noto Sans Kannada', sans-serif;
  --font-en: 'Inter', sans-serif;
  --text-size-base: 18px;
  --button-min: 56px;
}

/* Accessibility text sizes */
body.text-small { --text-size-base: 16px; --button-min: 48px; }
body.text-large { --text-size-base: 18px; --button-min: 56px; }
body.text-xlarge { --text-size-base: 22px; --button-min: 64px; }

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

html {
  font-size: var(--text-size-base);
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-en);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Typography ─── */
h1, h2, h3 {
  font-family: var(--font-kn);
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; }

.kn { font-family: var(--font-kn); }

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

.page {
  padding-bottom: 100px; /* space for bottom nav */
}

/* ─── Header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

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

.greeting {
  font-family: var(--font-kn);
  font-size: 1.5rem;
  font-weight: 700;
}

.clock {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ─── Search Bar ─── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-kn);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem;
  min-width: var(--button-min);
  min-height: calc(var(--button-min) - 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.search-bar button:hover {
  background: var(--bg-card);
}

.search-bar button.voice-active {
  color: var(--red);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Category Tabs ─── */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  flex-shrink: 0;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: var(--font-kn);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: calc(var(--button-min) - 8px);
  display: flex;
  align-items: center;
}

.category-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.category-tab:hover:not(.active) {
  background: var(--bg-card);
  border-color: var(--text-muted);
}

/* ─── Section Headers ─── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 1rem;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-kn);
}

.section-header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

/* ─── Bottom Navigation ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: color 0.2s;
  min-width: 60px;
}

.nav-item .nav-icon {
  font-size: 1.4rem;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item:hover {
  color: var(--text-primary);
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: var(--button-min);
  font-family: var(--font-en);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-success {
  background: var(--green);
  color: #fff;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-card);
}

.btn-block {
  width: 100%;
}

/* ─── Quick Actions ─── */
.quick-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-actions::-webkit-scrollbar { display: none; }

.quick-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.quick-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.quick-action .icon {
  font-size: 1.3rem;
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-hd {
  background: rgba(108, 92, 231, 0.2);
  color: var(--accent);
}

.badge-live {
  background: rgba(255, 107, 107, 0.2);
  color: var(--red);
}

.badge-today {
  background: rgba(0, 184, 148, 0.2);
  color: var(--green);
}

.badge-missed {
  background: rgba(255, 107, 107, 0.2);
  color: var(--red);
}

.badge-watching {
  background: rgba(253, 203, 110, 0.2);
  color: var(--amber);
}

.badge-watched {
  background: rgba(160, 160, 184, 0.15);
  color: var(--text-muted);
}

/* ─── Live Indicator Dot ─── */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); }
}

/* ─── Progress Bar ─── */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ─── Empty States ─── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
