/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary-green: #00ffa3;
  --primary-green-dim: rgba(0, 255, 163, 0.2);
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --glass-bg: rgba(17, 24, 39, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

/* 3D Mesh & Animated Background */
body {
  font-family: 'Inter', sans-serif;
  background-color: #050505;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(0, 255, 163, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(0, 163, 255, 0.08), transparent 25%);
  background-attachment: fixed;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
  animation: bgShift 10s infinite alternate linear;
}

@keyframes bgShift {
  0% { background-position: 0% 0%; }
  100% { background-position: 100px 50px; }
}

/* Smooth Page Load Transition */
.page-transition {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes fadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* --- Navigation Bar --- */
.navbar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  margin-top: 20px;
  border-radius: 16px;
  z-index: 100;
}

.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-green);
  text-shadow: 0 0 10px var(--primary-green-dim);
}

.login-btn-icon {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-btn-icon:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--primary-green);
}

/* --- Glassmorphism Core Class --- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- Modal Styles --- */
.modal {
  display: none; 
  position: fixed; 
  z-index: 1000; 
  left: 0; top: 0;
  width: 100%; height: 100%; 
  background-color: rgba(0,0,0,0.6); 
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  padding: 40px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
  animation: scaleUp 0.3s ease forwards;
}

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

.close {
  position: absolute;
  top: 15px; right: 20px;
  color: var(--text-muted);
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover { color: white; }

.modal-content h2 { margin-bottom: 25px; }

.auth-btn {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.05);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
}

.auth-btn:hover { background: rgba(255,255,255,0.1); }
.auth-btn.google:hover { border-color: #4285F4; }
.auth-btn.email:hover { border-color: var(--primary-green); }

.modal-footer { margin-top: 15px; font-size: 12px; color: var(--text-muted); }
.modal-footer a { color: var(--primary-green); text-decoration: none; font-weight: bold; }

/* --- Shared Layouts --- */
.container {
  max-width: 1000px;
  width: 100%;
  padding: 40px 20px;
  text-align: center;
}

.logo-header {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.text-green { color: var(--primary-green); text-shadow: 0 0 15px var(--primary-green-dim); }

.hero-section h1 { font-size: 48px; font-weight: 800; margin-bottom: 20px; letter-spacing: -1px; }
.hero-section p.subtitle { color: var(--text-muted); font-size: 18px; margin-bottom: 60px; }

/* --- UPDATED: Horizontal Alignment for Feature Cards --- */
.features-grid {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
  margin-bottom: 60px;
  width: 100%;
}

.feature-card {
  flex: 1; /* Forces all cards to have identical horizontal widths */
  min-width: 260px; 
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers the icon and text */
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border-color: rgba(255,255,255,0.2);
}

.btn-outline-glow {
  background: rgba(0, 255, 163, 0.1);
  color: var(--primary-green);
  border: 1px solid var(--primary-green);
  padding: 16px 32px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 0 15px var(--primary-green-dim);
  text-decoration: none;
  display: inline-block;
  backdrop-filter: blur(5px);
}

.btn-outline-glow:hover {
  background: var(--primary-green);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 255, 163, 0.4);
}

/* --- Speed Test Page Specifics --- */
.test-container { max-width: 500px; padding: 20px; text-align: center; margin: auto; }

.meter { margin: 40px 0; position: relative; }
.circle {
  width: 240px; height: 240px;
  border-radius: 50%; margin: auto;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 40%, transparent 70%);
  box-shadow: 
    0 0 40px rgba(0, 255, 163, 0.1) inset,
    0 0 20px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255,255,255,0.05);
  border-top: 4px solid var(--primary-green);
  animation: spin-pulse 2s linear infinite;
}

.circle .inner { animation: reverse-spin 2s linear infinite; }
@keyframes spin-pulse { 100% { transform: rotate(360deg); } }
@keyframes reverse-spin { 100% { transform: rotate(-360deg); } }

.circle h2 { font-size: 48px; font-weight: 800; color: var(--primary-green); }
#phase { margin-top: 20px; font-size: 18px; color: var(--text-muted); }

/* --- SEPARATED STATS BOXES --- */
.stats-wrapper {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center;
  align-items: stretch;
  gap: 15px;
  width: 100%;
  margin-top: 20px;
}

.stat-box {
  flex: 1;
  min-width: 100px;
  background: var(--glass-bg, rgba(17, 24, 39, 0.45));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 10px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-box:hover {
  border-color: var(--primary-green, #00ffa3);
  transform: translateY(-5px);
  box-shadow: 
    0 10px 30px rgba(0, 255, 163, 0.2), 
    inset 0 0 15px rgba(0, 255, 163, 0.05);
}

.stat-box .label {
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  font-weight: 600;
}

.stat-box .value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main, #ffffff);
}

.stat-box .unit {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
  margin-left: 2px;
}

/* --- ENHANCED RESULT BOX --- */
.result-box {
  margin-top: 40px !important;
  padding: 35px 30px;
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 255, 163, 0.4);
  box-shadow: 
    0 15px 40px rgba(0, 0, 0, 0.6), 
    0 0 60px rgba(0, 255, 163, 0.12),
    inset 0 0 25px rgba(0, 255, 163, 0.08);
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.result-box h2#score {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 25px;
  letter-spacing: -0.5px;
}

.result-box .bar {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 25px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.result-box .fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00ffa3, #00b8ff);
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px var(--primary-green);
}

.result-box #status {
  font-size: 20px;
  color: var(--primary-green);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(0, 255, 163, 0.3);
}

.result-box #recommendation {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 90%;
}

/* style.css */

/* 1. This part is essential to make "margin-top: auto" work */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Takes up the full height of the screen */
  align-items: center;
}

/* 2. Simple white text centered at the very bottom */
.footer-text {
  margin-top: auto;        /* Pushes the text to the absolute bottom */
  padding: 340px 0 10px 0;  /* Adds space so it's not touching the edge */
  color: #ffffff;          /* Pure white color as requested */
  font-size: 13px;
  opacity: 0.8;            /* Slightly dimmed so it doesn't distract from the main UI */
  width: 100%;
  text-align: center;
  letter-spacing: 0.5px;
}