/* =============================================
   OpenDTV — Main Stylesheet
   Design: Dark tech / clean, mobile-first
   ============================================= */

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

:root {
  --bg-base:       #0d0f14;
  --bg-surface:    #13161e;
  --bg-card:       #181c26;
  --bg-card-hover: #1e2330;
  --border:        #252a38;
  --border-hover:  #3a4255;

  --text-primary:  #f0f2f7;
  --text-secondary:#8b93a8;
  --text-muted:    #5a6278;

  --accent:        #4f7ef8;
  --accent-light:  #7ba3ff;
  --accent-glow:   rgba(79, 126, 248, 0.18);

  --green:  #34d399;
  --purple: #a78bfa;
  --orange: #fb923c;
  --pink:   #f472b6;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;

  --shadow-card: 0 2px 16px rgba(0,0,0,0.35);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.5);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.22s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img { max-width: 100%; display: block; }

/* --- Utility --- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.logo-icon { font-size: 1.3rem; }

.logo-text {
  background: linear-gradient(135deg, #4f7ef8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(79,126,248,0.12) 0%, transparent 70%);
}

/* Subtle dot-grid background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--accent-glow);
  border: 1px solid rgba(79,126,248,0.3);
  color: var(--accent-light);
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 30%, #a0b4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  letter-spacing: 0.01em;
}

/* Search */
.search-form {
  max-width: 540px;
  margin: 0 auto;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 18px;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.6;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 0;
}

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

.search-btn {
  padding: 8px 22px;
  border-radius: calc(var(--radius-lg) - 4px);
  border: none;
  background: linear-gradient(135deg, var(--accent), #6b48ff);
  color: #fff;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.search-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* =============================================
   SECTION SHELL
   ============================================= */
.section {
  padding: 72px 0;
}

.section--alt {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

/* =============================================
   FOUR NAV CARDS
   ============================================= */
.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.nav-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.nav-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-hover);
}

.nav-card:hover::before { opacity: 1; }

/* Color accents per card */
.nav-card--streaming::before { background: linear-gradient(90deg, var(--accent), var(--purple)); }
.nav-card--livetv::before    { background: linear-gradient(90deg, var(--green), #0ea5e9); }
.nav-card--apps::before      { background: linear-gradient(90deg, var(--orange), #facc15); }
.nav-card--devices::before   { background: linear-gradient(90deg, var(--pink), var(--purple)); }

.nav-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.nav-card-body { flex: 1; min-width: 0; }

.nav-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.nav-card-body p {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.nav-card-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}

.nav-card:hover .nav-card-arrow {
  transform: translateX(4px);
  color: var(--accent-light);
}

/* =============================================
   FEATURED GRID
   ============================================= */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition:
    transform var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.featured-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-hover);
}

.featured-card-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.featured-card-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.featured-card-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
}

.featured-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.footer-nav a {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.footer-nav a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .hero { padding: 72px 0 60px; }

  .nav-cards-grid {
    grid-template-columns: 1fr;
  }

  .nav-card { padding: 18px 16px; }

  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links a { padding: 6px 10px; }
}

@media (max-width: 480px) {
  .featured-grid {
    grid-template-columns: 1fr 1fr;
  }

  .search-btn { padding: 8px 14px; font-size: 0.8rem; }
}
