/* Premium Design Tokens */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: rgba(33, 38, 45, 0.75);
  --border-color: rgba(48, 54, 61, 0.7);
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --accent-color: #ffaa00;
  --accent-hover: #ffaa00;
  --accent-secondary: #ff5500;
  --success-color: #3fb950;
  --danger-color: #f85149;
  --font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --skeleton-bg: rgba(33, 38, 45, 0.4);
  --skeleton-highlight: rgba(255, 255, 255, 0.05);
}

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

.skeleton {
  background: linear-gradient(90deg, var(--skeleton-bg) 25%, var(--skeleton-highlight) 50%, var(--skeleton-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Base Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-orange { color: var(--accent-color); }
.text-green { color: var(--success-color); }
.text-red { color: var(--danger-color); }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pb-5 { padding-bottom: 3.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-5 { margin-bottom: 3rem; }

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

/* Glassmorphic/Premium Background Screens */
.app-screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--bg-primary);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.app-screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

.app-main {
  padding-top: 75px !important;
  padding-bottom: 145px !important;
  background: radial-gradient(circle at top left, rgba(255, 170, 0, 0.05), transparent 60%);
}

/* Buttons and Form Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-primary {
  background-color: var(--bg-secondary);
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}
.btn-primary:hover {
  background-color: var(--accent-color);
  color: var(--bg-primary);
  box-shadow: 0 0 15px rgba(255, 170, 0, 0.4);
}

.btn-premium {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(255, 85, 0, 0.35);
}
.btn-premium:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 85, 0, 0.5);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  background-color: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.35rem;
  cursor: pointer;
  display: inline-flex;
}

/* Spinner Overlay */
.spinner-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-box {
  text-align: center;
}

.spinner-element {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-secondary);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 15px;
}

.spinner-box p {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 1. SPLASH SCREEN STYLES */
#splash-screen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary), #000);
}

.splash-content {
  text-align: center;
  animation: pulseIn 1s cubic-bezier(0.1, 0.9, 0.2, 1);
}

#splash-logo {
  width: 140px;
  height: 140px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 20px rgba(255, 170, 0, 0.4));
}

.app-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(to right, var(--accent-color), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

@keyframes pulseIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* 2. INTRO SLIDER */
#intro-screen {
  justify-content: space-between;
  padding: 2.5rem 1.5rem;
}

.intro-carousel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.intro-slide {
  display: none;
  text-align: center;
}

.intro-slide.active {
  display: block;
  animation: slideFadeIn 0.4s ease-in-out;
}

.intro-img-box {
  width: 130px;
  height: 130px;
  background: rgba(255, 170, 0, 0.06);
  border: 1px solid rgba(255, 170, 0, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2.5rem;
}

.intro-icon {
  font-size: 3.5rem;
  color: var(--accent-color);
}

.intro-slide h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.intro-slide p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 auto;
}

@keyframes slideFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.intro-controls {
  width: 100%;
}

.intro-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
  cursor: pointer;
  transition: all 0.3s;
}

.dot.active {
  width: 25px;
  border-radius: 12px;
  background-color: var(--accent-color);
}

/* AUTH FORMS (Login / Register) */
.auth-header {
  margin-bottom: 2.5rem;
  margin-top: 1rem;
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  color: var(--text-muted);
}

.auth-form .form-group {
  margin-bottom: 1.45rem;
}

.auth-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-family: var(--font-family);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.auth-form input:focus {
  border-color: var(--accent-color);
  background: rgba(33, 38, 45, 1);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.15);
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

/* FIXED HEADERS AND FOOTERS */
.app-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 60px !important;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 9999 !important;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 32px;
  height: 32px;
}

.header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

#header-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* AD PLACEMENTS */
.ad-container, .bottom-ad-container {
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 1rem;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-label {
  display: none !important;
}

.ad-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
}

.ad-slot::before {
  content: "Ad";
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
  line-height: 1.2;
}

.ad-slot img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.bottom-ad-container {
  border-top: 1px solid var(--border-color);
  margin-bottom: 0;
  background: var(--bg-primary);
}

.bottom-ad-container .ad-slot {
  min-height: 50px;
  padding: 4px;
}

/* SECTION HEADERS */
.section-container {
  margin-top: 1rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

/* NEWS CARDS */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 170, 0, 0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.news-card-img-box {
  width: 100%;
  height: 200px;
  background: #0b0e14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.news-card-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: 0.3s ease-in-out;
}

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

.news-card-body {
  padding: 1.15rem;
}

.news-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}

.news-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.news-card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* NAVIGATION FOOTER TAB BAR */
.app-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  background: rgba(22, 27, 34, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  z-index: 9999 !important;
}

.bottom-nav {
  display: flex;
  height: 62px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.75rem;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.nav-item i {
  font-size: 1.25rem;
}

.nav-item.active {
  color: var(--accent-color);
  background: rgba(255, 170, 0, 0.04);
  font-weight: 600;
}

/* QUIZ STYLES */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.quiz-q-num {
  font-size: 0.8rem;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
  display: block;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.option-label {
  background: rgba(33, 38, 45, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.option-label:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.option-label input[type="radio"] {
  display: none;
}

.option-label .radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: inline-block;
  position: relative;
  transition: 0.2s;
  flex-shrink: 0;
}

.option-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--accent-color);
  background: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
}

.option-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.option-label input[type="radio"]:checked ~ span {
  color: var(--text-main);
  font-weight: 600;
}

/* TIMER ELEMENT FOR THE ONE-BY-ONE QUIZ */
.timer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 85, 0, 0.1);
  border: 1px solid rgba(255, 85, 0, 0.25);
  border-radius: 12px;
  padding: 0.65rem 1.15rem;
  margin-bottom: 1.25rem;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--danger-color);
}

.timer-box i {
  animation: alarm-shake 1s ease-in-out infinite alternate;
}

@keyframes alarm-shake {
  from { transform: rotate(-8deg); }
  to { transform: rotate(8deg); }
}

/* RESULT SCREEN */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem 1.5rem;
}

.result-score-circle {
  width: 110px;
  height: 110px;
  border: 4px solid rgba(255, 170, 0, 0.2);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

#result-percentage {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
}

.result-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.result-description {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}

.stats-row {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 1rem 0.5rem;
  margin-bottom: 1rem;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* FULL NEWS MODAL VIEW */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  animation: modalIn 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
  transition: 0.2s;
}
.close-btn:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 1.35rem;
  overflow-y: auto;
  flex: 1;
}

#modal-image-box {
  width: 100%;
  max-height: 220px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.15rem;
  background: rgba(33, 38, 45, 0.5);
}

#modal-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-desc {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1.15rem;
  white-space: pre-wrap;
}

.modal-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* AUTHENTICATION SCREENS */
.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo-box {
  width: 75px;
  height: 75px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  overflow: hidden;
}

.auth-logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: #fff;
}
