/* Virtual Parta - Riyaziyyat Veb Oyunları - Əsas Stil Faylı */

:root {
  --primary-color: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --secondary-color: #0EA5E9;
  --secondary-hover: #0284C7;
  --success-color: #10B981;
  --success-hover: #059669;
  --error-color: #EF4444;
  --error-hover: #DC2626;
  --warning-color: #F59E0B;
  --warning-hover: #D97706;

  --bg-gradient: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #311042 100%);
  --card-bg: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.15);
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;

  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.4);

  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Nav */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #A5B4FC, #C084FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.btn-icon:active {
  transform: translateY(0);
}

/* Common Layout Components */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #818CF8, #F472B6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Card UI */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #1E293B;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: var(--text-main);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

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

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-main);
}

/* High Scores Table */
.scores-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.scores-table th, .scores-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

.scores-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.scores-table td:last-child {
  text-align: right;
  font-weight: 800;
  color: var(--warning-color);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.footer a {
  color: #818CF8;
  text-decoration: none;
}

/* Animations */
@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.8); }
}

.animate-pop {
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .header { padding: 0.75rem 1rem; }
  .brand-title { font-size: 1rem; }
  .container { padding: 1rem; }
  .page-title { font-size: 1.5rem; }
}

/* User Greeting Card & Settings */
.user-greeting-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.user-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #38BDF8, #818CF8);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.greeting-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.user-name-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

/* Leaderboard Tabs & Modal */
.leaderboard-tabs {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.75rem;
}

.tab-btn {
  flex: 1;
  padding: 0.65rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

/* App Promotion Card (Android Funnel) */
.app-promo-card {
  margin-top: 2.5rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(30, 27, 75, 0.98) 100%);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 30px rgba(79, 70, 229, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.app-promo-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(230, 81, 0, 0.2);
  border: 1px solid rgba(230, 81, 0, 0.4);
  color: #FF8A65;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.app-promo-title {
  font-size: 1.65rem;
  font-weight: 900;
  background: linear-gradient(90deg, #F8FAFC, #A5B4FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.app-promo-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.app-promo-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0.5rem 0;
}

.promo-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.promo-feature-item:hover {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-2px);
}

.promo-feature-item .feature-icon {
  font-size: 1.75rem;
  line-height: 1;
  shrink: 0;
}

.promo-feature-item strong {
  display: block;
  font-size: 0.95rem;
  color: white;
  margin-bottom: 0.2rem;
}

.promo-feature-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.app-promo-cta {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-google-play {
  background: linear-gradient(135deg, #E65100, #F57C00) !important;
  box-shadow: 0 6px 20px rgba(230, 81, 0, 0.4) !important;
  padding: 0.85rem 2.25rem !important;
  border-radius: var(--radius-md) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  color: white !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.85rem !important;
}

.btn-google-play:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 10px 28px rgba(230, 81, 0, 0.6) !important;
}

/* Link & Button Text Decoration Reset */
a, a:hover, a:focus, a:active, a:visited {
  text-decoration: none !important;
}

.btn-primary, .btn-secondary, .btn-icon, .btn-rush {
  text-decoration: none !important;
}

/* ==========================================================================
   Light Mode Theme Overrides
   ========================================================================== */
html.light-mode,
body.light-mode {
  --bg-gradient: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 50%, #EEF2FF 100%) !important;
  --card-bg: #FFFFFF !important;
  --card-border: #CBD5E1 !important;
  --text-main: #0F172A !important;
  --text-muted: #475569 !important;
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04) !important;
  background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 50%, #EEF2FF 100%) !important;
  color: #0F172A !important;
}

/* Header & Navigation */
.light-mode .header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid #CBD5E1 !important;
}

.light-mode .brand-title {
  background: linear-gradient(90deg, #4338CA, #6D28D9) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.light-mode .page-title {
  background: linear-gradient(90deg, #4338CA, #BE185D) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.light-mode .btn-icon {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

.light-mode .btn-icon:hover {
  background: #F1F5F9 !important;
  border-color: #94A3B8 !important;
}

/* User Greeting Card */
.light-mode .user-greeting-card {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
}

.light-mode .user-name-title {
  color: #0F172A !important;
}

.light-mode .greeting-subtitle {
  color: #64748B !important;
}

/* Game Config Section & Chips (100 dairəsində əməllər və s.) */
.light-mode .config-card {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

.light-mode .config-card h2 {
  color: #0F172A !important;
}

.light-mode .config-title {
  color: #312E81 !important;
  font-weight: 800 !important;
}

.light-mode .chip {
  background: #F8FAFC !important;
  border: 2px solid #CBD5E1 !important;
  color: #334155 !important;
}

.light-mode .chip:hover:not(.active) {
  background: #E2E8F0 !important;
  border-color: #94A3B8 !important;
  color: #0F172A !important;
}

.light-mode .chip.active {
  background: linear-gradient(135deg, #4F46E5, #0EA5E9) !important;
  border-color: #4338CA !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
}

/* App Promotion Banner (Android App Funnel) */
.light-mode .app-promo-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFF7ED 100%) !important;
  border: 1.5px solid #FED7AA !important;
  box-shadow: 0 10px 30px rgba(234, 88, 12, 0.08) !important;
}

.light-mode .app-promo-badge {
  background: #FFEDD5 !important;
  border: 1px solid #FDBA74 !important;
  color: #C2410C !important;
  font-weight: 800 !important;
}

.light-mode .app-promo-title {
  background: linear-gradient(90deg, #1E293B, #C2410C) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.light-mode .app-promo-desc {
  color: #475569 !important;
}

.light-mode .promo-feature-item {
  background: #FFFFFF !important;
  border: 1px solid #FFEDD5 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.light-mode .promo-feature-item:hover {
  background: #FFF7ED !important;
  border-color: #FDBA74 !important;
}

.light-mode .promo-feature-item strong {
  color: #0F172A !important;
}

.light-mode .promo-feature-item p {
  color: #64748B !important;
}

/* Modal Promo Banner Light Mode Overrides */
.light-mode .modal-app-promo-box {
  background: #FFF7ED !important;
  border-color: #FFEDD5 !important;
}

.light-mode .modal-app-promo-title {
  color: #C2410C !important;
}

.light-mode .modal-app-promo-desc {
  color: #475569 !important;
}

/* Modals & Tables */
.light-mode .modal-content {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border: 1px solid #CBD5E1 !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.light-mode .modal-title {
  color: #0F172A !important;
}

.light-mode .scores-table th,
.light-mode .scores-table td {
  border-bottom: 1px solid #E2E8F0 !important;
  color: #0F172A !important;
}

.light-mode .scores-table th {
  color: #64748B !important;
}

.light-mode .tab-btn {
  background: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #475569 !important;
}

.light-mode .tab-btn:hover {
  background: #E2E8F0 !important;
  color: #0F172A !important;
}

.light-mode .tab-btn.active {
  background: linear-gradient(135deg, #4F46E5, #0EA5E9) !important;
  color: white !important;
}

.light-mode .game-card-title {
  color: #0F172A !important;
}

/* Practice & Rush Game Elements Light Mode */
.light-mode .stat-box,
.light-mode .stats-bar {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

.light-mode .stat-val {
  color: #0F172A !important;
}

.light-mode .stat-label {
  color: #64748B !important;
}

.light-mode .equation-text,
.light-mode .equation-display {
  color: #0F172A !important;
  text-shadow: none !important;
}

.light-mode .sum-indicator {
  color: #334155 !important;
}

.light-mode .tile {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}

.light-mode .tile:hover:not(.selected) {
  background: #F1F5F9 !important;
}

.light-mode .tile.selected {
  background: linear-gradient(135deg, #4F46E5, #0EA5E9) !important;
  color: #FFFFFF !important;
}

.light-mode .answer-input {
  background: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #94A3B8 !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.light-mode .answer-input:focus {
  border-color: #4F46E5 !important;
  box-shadow: 0 0 12px rgba(79, 70, 229, 0.3) !important;
}

.light-mode .num-btn {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

.light-mode .num-btn:hover {
  background: #E2E8F0 !important;
}

.light-mode .num-btn.btn-action {
  background: #FEE2E2 !important;
  border-color: #FCA5A5 !important;
  color: #DC2626 !important;
}



