/* ====== ALEX SKY NEWS — MOBILE APP STYLE ====== */
/* Mobile-first, responsive sports news app */

:root {
  --app-bg: #0a0a14;
  --app-card: #12121f;
  --app-surface: #1a1a2e;
  --app-border: #2a2a40;
  --app-accent: #ff6b35;
  --app-accent2: #00d4aa;
  --app-text: #f0f0f8;
  --app-muted: #7a7a9a;
  --app-radius: 14px;
  --nav-height: 60px;
  --header-height: 52px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--app-bg);
  color: var(--app-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--nav-height);
}

/* ── HEADER ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(10,10,20,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--app-border);
  height: var(--header-height);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.app-logo svg {
  width: 28px;
  height: 28px;
}

.app-logo span {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.header-btn:active {
  background: var(--app-border);
}

/* ── FEED TOGGLE ── */
.feed-toggle-section {
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--app-card);
  margin: 0.5rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--app-border);
}

.feed-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feed-toggle-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.feed-toggle-label .dot.active {
  background: var(--app-accent2);
  box-shadow: 0 0 8px rgba(0,212,170,0.5);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--app-border);
  border-radius: 13px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--app-accent2);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* ── FEATURED ARTICLE ── */
.featured-section {
  padding: 0.5rem 0.8rem;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--app-accent), #e85a20);
  color: #fff;
  margin-bottom: 0.5rem;
}

.featured-card {
  position: relative;
  border-radius: var(--app-radius);
  overflow: hidden;
  background: var(--app-card);
  border: 1px solid var(--app-border);
  cursor: pointer;
  transition: transform 0.2s;
}

.featured-card:active {
  transform: scale(0.98);
}

.featured-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.featured-image .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,10,20,0.9) 0%, rgba(10,10,20,0.1) 60%);
}

.featured-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.6rem 0.8rem;
  padding-bottom: 0;
}

.featured-tag {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  background: rgba(255,107,53,0.12);
  color: var(--app-accent);
  border: 1px solid rgba(255,107,53,0.2);
}

.featured-tag.nba { background: rgba(230,57,70,0.12); color: #e63946; border-color: rgba(230,57,70,0.2); }
.featured-tag.wc { background: rgba(0,212,170,0.12); color: var(--app-accent2); border-color: rgba(0,212,170,0.2); }
.featured-tag.foot { background: rgba(100,210,255,0.12); color: #64d2ff; border-color: rgba(100,210,255,0.2); }
.featured-tag.mer { background: rgba(255,215,0,0.12); color: #ffd700; border-color: rgba(255,215,0,0.2); }

.featured-title {
  padding: 0.5rem 0.8rem 0.8rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.featured-meta {
  padding: 0 0.8rem 0.8rem;
  font-size: 0.72rem;
  color: var(--app-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── ARTICLE GALLERY ── */
.gallery-section {
  padding: 0.5rem 0.8rem;
}

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

.gallery-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--app-muted);
}

.gallery-header a {
  font-size: 0.75rem;
  color: var(--app-accent);
  text-decoration: none;
  font-weight: 600;
}

.gallery-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-item:active {
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.gallery-item:last-child {
  border-bottom: none;
}

.gallery-thumb {
  width: 90px;
  height: 72px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.gallery-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.gallery-tags {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.2rem;
}

.gallery-tag {
  font-size: 0.55rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: var(--app-muted);
}

.gallery-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-meta {
  font-size: 0.68rem;
  color: var(--app-muted);
  margin-top: 0.15rem;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.3rem 0;
  padding-bottom: max(0.3rem, env(safe-area-inset-bottom));
  background: rgba(10,10,20,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--app-border);
  height: var(--nav-height);
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--app-muted);
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 0.2rem 0.6rem;
  min-width: 50px;
}

.nav-tab:active,
.nav-tab.active {
  color: var(--app-accent2);
}

.nav-tab svg {
  width: 22px;
  height: 22px;
}

.nav-tab span {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.nav-tab.active span {
  color: var(--app-accent2);
}

/* ── RESPONSIVE (tablet+) ── */
@media (min-width: 600px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid var(--app-border);
    border-right: 1px solid var(--app-border);
    min-height: 100vh;
  }
  
  .bottom-nav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.featured-card {
  animation: fadeUp 0.5s ease-out;
}

.gallery-item {
  animation: fadeUp 0.4s ease-out backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }

/* ══ SCORES LIVE SECTION ══ */
.scores-section {
  padding: 0.5rem 0.8rem;
}

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

.scores-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--app-text);
}

.scores-count {
  font-size: 0.68rem;
  color: var(--app-muted);
}

.scores-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.3rem;
  scrollbar-width: none;
}

.scores-scroll::-webkit-scrollbar {
  display: none;
}

/* Score card */
.score-card {
  min-width: 200px;
  max-width: 220px;
  flex-shrink: 0;
  background: var(--app-card);
  border-radius: 12px;
  border: 1px solid var(--app-border);
  padding: 0.7rem 0.8rem;
  scroll-snap-align: start;
  transition: border-color 0.2s;
}

.score-card:active {
  border-color: var(--app-accent2);
}

.score-card.live {
  border-color: rgba(230,57,70,0.4);
}

.score-card.finished {
  border-color: rgba(0,212,170,0.2);
}

/* Top row: time + status */
.score-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.score-time {
  font-size: 0.68rem;
  color: var(--app-muted);
  font-weight: 500;
}

.score-status {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
}

.score-status.live {
  background: rgba(230,57,70,0.15);
  color: #e63946;
}

.score-status.finished {
  background: rgba(0,212,170,0.12);
  color: var(--app-accent2);
}

.score-status.upcoming {
  background: rgba(100,210,255,0.1);
  color: #64d2ff;
}

/* Team rows */
.score-team-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}

.score-team-row + .score-team-row {
  margin-top: 0.15rem;
}

.score-team-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.score-team-name {
  font-size: 0.75rem;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-team-score {
  font-size: 0.9rem;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--app-text);
}

.score-team-score.live-score {
  color: var(--app-accent2);
}

/* Competition label */
.score-comp {
  font-size: 0.58rem;
  color: var(--app-muted);
  margin-top: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}

@media (min-width: 600px) {
  .scores-scroll {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .score-card {
    min-width: calc(50% - 0.3rem);
    max-width: none;
  }
}

/* ══ SEARCH BAR ══ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--app-card);
  margin: 0 0.8rem 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--app-accent);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); max-height: 0; }
  to { opacity: 1; transform: translateY(0); max-height: 60px; }
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--app-text);
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0.4rem 0;
}

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

.search-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══ THEME TOGGLE — Sun/Moon ══ */
.sun-icon, .moon-icon {
  transition: opacity 0.3s;
}

/* Light theme overrides */
html.light {
  --app-bg: #f4f4f9;
  --app-card: #ffffff;
  --app-surface: #eaeaef;
  --app-border: #d0d0e0;
  --app-text: #1a1a2e;
  --app-muted: #7a7a9a;
}

html.light .app-header {
  background: rgba(255,255,255,0.92);
}

html.light .bottom-nav {
  background: rgba(255,255,255,0.95);
}

html.light .search-input::placeholder {
  color: #999;
}
