/* Cricket AI News CMS - Main Theme Stylesheet (ESPN Cricinfo x Google News Aesthetic) */

:root {
  --bg-primary: #0b0f19;
  --bg-surface: #131b2e;
  --bg-card: #1c2640;
  --bg-glass: rgba(28, 38, 64, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-color: #00e676;
  --accent-hover: #00c853;
  --accent-glow: rgba(0, 230, 118, 0.3);
  --live-red: #ff3366;
  --header-bg: rgba(11, 15, 25, 0.95);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-color: #00c853;
  --accent-hover: #00a142;
  --accent-glow: rgba(0, 200, 83, 0.2);
  --live-red: #d50000;
  --header-bg: rgba(255, 255, 255, 0.95);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary) !important;
  letter-spacing: -0.5px;
}

.brand-logo span {
  color: var(--accent-color);
}

.nav-link-custom {
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-link-custom:hover, .nav-link-custom.active {
  color: var(--accent-color);
  background: rgba(0, 230, 118, 0.08);
  text-decoration: none;
}

/* Live Score Ticker Bar */
.live-ticker-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  overflow-x: auto;
  white-space: nowrap;
}

.ticker-item {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  margin-right: 0.75rem;
  font-size: 0.85rem;
}

.badge-live {
  background: var(--live-red);
  color: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Main Cards */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

.news-card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background: var(--bg-surface);
}

.news-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-card:hover .news-card-img {
  transform: scale(1.05);
}

.news-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.news-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.news-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* AI Badge */
.ai-badge {
  background: linear-gradient(135deg, #00e676, #00b0ff);
  color: #000;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Table of Contents */
.toc-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.toc-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--accent-color);
}

.toc-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc-list li {
  margin-bottom: 0.4rem;
}

.toc-list a {
  color: var(--text-secondary);
}

.toc-list a:hover {
  color: var(--accent-color);
}

/* Article Content Formatting */
.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body h2 {
  font-weight: 800;
  font-size: 1.6rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  border-left: 4px solid var(--accent-color);
  padding-left: 0.75rem;
}

.article-body h3 {
  font-weight: 700;
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.article-body blockquote {
  background: var(--bg-surface);
  border-left: 4px solid var(--accent-color);
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

/* Sidebar Widgets */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Ad Placeholder Box */
.ad-placeholder-box {
  background: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
}

.ad-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Skeleton Loading Screen */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1.5rem 0;
  margin-top: 4rem;
}
