/* =========================================
   COMPONENTS.CSS - Global Theme, Navbar, Footer & Results
   (ULTIMATE FIXED VERSION)
========================================= */

:root {
  --bg-main: #0b1220; /* Deep Slate Blue */
  --card-bg-solid: rgba(30, 41, 59, 0.72);
  --card-bg-grad: linear-gradient(145deg, rgba(17, 24, 39, 0.94), rgba(30, 41, 59, 0.92));
  --border-glass: rgba(255, 255, 255, 0.06);
  --primary-blue: #3b82f6;
  --glow-blue: rgba(59, 130, 246, 0.35);
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  /* Padding top yahan se hata di gayi hai kyunki ab hum placeholder use kar rahe hain */
}

/* =========================================
   GLOBAL APP LOADER
========================================= */
#app-loader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
  background: radial-gradient(circle at center, #111827, #020617);
  display: flex; justify-content: center; align-items: center;
  z-index: 999999; transition: opacity 0.5s ease;
}
.loader-text {
  font-size: 24px; font-weight: 800; letter-spacing: 0.8px;
  background: linear-gradient(90deg, #60a5fa, #c084fc, #22d3ee, #60a5fa);
  background-size: 300%; -webkit-background-clip: text; color: transparent;
  animation: loaderGlow 5s linear infinite;
}
@keyframes loaderGlow { 0% { background-position: 0%; } 100% { background-position: 300%; } }

/* GLOBAL STARS BACKGROUND */
#stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none; opacity: 0.5;
}

/* =========================================
   1. HEADER & NAVBAR COMPONENT (TOP FIXED)
========================================= */

/* Placeholder khud 70px ki jagah lega taaki content chhupe nahi */
#navbar-placeholder {
  width: 100%;
  height: 70px; 
  display: block;
}

/* Header humesha screen ke top par fixed rahega */
.header {
  position: fixed; 
  top: 0;
  left: 0;
  width: 100%; 
  height: 70px; 
  z-index: 99999; /* Sabse upar lock kar diya */
  
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 0 20px; 
  box-sizing: border-box;
  
  background: rgba(11, 18, 32, 0.95); 
  backdrop-filter: blur(16px); 
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.logo {
  font-size: 24px; 
  font-weight: 800; 
  color: #fff;
  letter-spacing: 0.5px; 
  text-shadow: 0 0 18px rgba(96, 165, 250, 0.45);
  margin: 0; 
  display: flex; 
  align-items: center;
}

.menu-toggle {
  background: none; 
  border: none; 
  cursor: pointer;
  display: flex; 
  flex-direction: column; 
  gap: 5px; 
  z-index: 101;
  padding: 5px; 
  margin: 0;
}

.menu-toggle span {
  width: 24px; 
  height: 2px; 
  background: #fff; 
  border-radius: 2px; 
  transition: 0.3s ease;
}

/* Hamburger Animations */
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--primary-blue); box-shadow: 0 0 10px var(--primary-blue); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--primary-blue); box-shadow: 0 0 10px var(--primary-blue); }

.dropdown-menu {
  position: fixed; top: 75px; right: 20px; width: 200px;
  background: rgba(17, 24, 39, 0.95); backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass); border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0; transform: translateY(-15px); pointer-events: none;
  transition: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.2); z-index: 99998;
}
.dropdown-menu.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-menu button {
  background: transparent; color: #cbd5e1; border: none;
  padding: 12px; text-align: left; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; transition: 0.3s; cursor: pointer;
}
.dropdown-menu button:hover {
  background: var(--primary-blue); color: #fff;
  transform: translateX(5px); box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* =========================================
   2. FOOTER COMPONENT (BOTTOM FIXED)
========================================= */

/* Placeholder taaki page ka aakhri content footer ke piche na chhupe */
#footer-placeholder {
  width: 100%;
  height: 90px; 
  display: block;
}

/* Footer humesha screen ke bottom par fixed rahega */
.footer {
  position: fixed; 
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 9998; /* Navbar ke just neeche wali priority */
  margin: 0; 
  padding: 15px 10px; 
  text-align: center;
  
  background: rgba(11, 18, 32, 0.95); 
  backdrop-filter: blur(16px); 
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glass);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.home-footer { 
  display: flex; 
  justify-content: center; 
  gap: 25px; 
  flex-wrap: wrap; 
  margin-bottom: 10px; 
}

.home-footer a { 
  position: relative; 
  color: var(--text-muted); 
  text-decoration: none; 
  font-size: 14px; 
  font-weight: 600; 
  transition: 0.3s; 
}

.home-footer a::after {
  content: ""; 
  position: absolute; 
  left: 0; 
  bottom: -5px; 
  width: 0%; 
  height: 2px;
  background: var(--primary-blue); 
  transition: 0.3s ease;
}

.home-footer a:hover { 
  color: var(--primary-blue); 
  text-shadow: 0 0 10px var(--primary-blue); 
}

.home-footer a:hover::after { 
  width: 100%; 
}

.app-version { 
  color: #64748b; 
  font-size: 13px; 
  letter-spacing: 0.4px; 
  font-weight: 700; 
  margin: 0;
}

/* =========================================
   3. RESULT CARD COMPONENT
========================================= */
.result-card-container {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(30, 41, 59, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 28px;
  padding: 30px 20px; text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative; overflow: hidden; max-width: 500px; margin: 0 auto;
}
.result-glow {
  position: absolute; top: -50px; left: 50%; transform: translateX(-50%);
  width: 150px; height: 150px; background: rgba(59, 130, 246, 0.4);
  filter: blur(60px); z-index: 0; pointer-events: none;
}
.result-title {
  position: relative; z-index: 1; font-size: 2.2rem; font-weight: 900; margin-bottom: 5px;
  background: linear-gradient(90deg, #00dbde, #fc00ff); -webkit-background-clip: text; color: transparent;
  text-shadow: 0 0 20px rgba(252, 0, 255, 0.3);
}
.result-subtitle { position: relative; z-index: 1; color: #9ca3af; font-size: 0.95rem; margin-bottom: 25px; }
.result-stats-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.stat-box {
  background: rgba(11, 18, 32, 0.6); padding: 20px 10px; border-radius: 20px; 
  border: 1px solid rgba(255,255,255,0.05); box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}
.stat-value { font-size: 2.2rem; font-weight: 800; }
.blue-glow { color: #3b82f6; text-shadow: 0 0 15px rgba(59, 130, 246, 0.5); }
.orange-glow { color: #f59e0b; text-shadow: 0 0 15px rgba(245, 158, 11, 0.5); }
.stat-label { font-size: 0.75rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; margin-top: 5px; }
.result-details-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 30px; }
.detail-box { background: rgba(255, 255, 255, 0.03); padding: 16px 5px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.correct-box { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); box-shadow: 0 0 10px rgba(16, 185, 129, 0.1); }
.wrong-box { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); box-shadow: 0 0 10px rgba(239, 68, 68, 0.1); }
.detail-value { font-size: 1.4rem; font-weight: 800; }
.detail-label { font-size: 0.7rem; text-transform: uppercase; font-weight: 600; margin-top: 4px; }
.text-white { color: #e5e7eb; } .text-green { color: #10b981; } .text-red { color: #ef4444; }
.result-actions { position: relative; z-index: 1; display: flex; gap: 15px; }
.btn-outline {
  flex: 1; padding: 16px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.08); 
  color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.3s;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-primary {
  flex: 1; padding: 16px; border-radius: 16px; border: none; background: linear-gradient(135deg, #3b82f6, #9333ea); 
  color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.3s; box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(59, 130, 246, 0.6); }

/* GLOBAL ANIMATIONS */
.animate-item { opacity: 0; transform: translateY(30px); animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes slideUpFade { to { opacity: 1; transform: translateY(0); } }
