/* GSSSB CBRT Pro Platform - Modern SaaS Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --primary-light: #e0e7ff;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px rgba(67, 56, 202, 0.25);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--dark);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* ----------------- Top Navigation Bar ----------------- */
.navbar {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2000;
  padding: 0.75rem 1.25rem;
  width: 100%;
}
.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}
.nav-logo-badge {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.nav-menu-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  margin-left: 2rem;
}
.mobile-nav-header {
  display: none;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}
.nav-link {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
}
.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}
.nav-user-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--dark);
}

.mobile-nav-toggle {
  display: none;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--dark);
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.mobile-nav-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1990;
  pointer-events: none;
}
.mobile-nav-backdrop.active {
  display: block;
  pointer-events: auto;
}



/* ----------------- Buttons & Badges ----------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}
.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  box-shadow: 0 4px 10px rgba(67, 56, 202, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3730a3, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(67, 56, 202, 0.35);
  color: white;
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: #1e1b4b;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}
.btn-accent:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge-free {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge-pro {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border: 1px solid #fcd34d;
}
.badge-locked {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ----------------- Cards & Containers ----------------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-md);
}

/* ----------------- Hero Banner ----------------- */
.hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: white;
  padding: 4rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero h1 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero p {
  color: #c7d2fe;
  font-size: 1.15rem;
  max-width: 750px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
}
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.hero-badge-item {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ----------------- Exam Papers Grid ----------------- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.exams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.exam-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}
.exam-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}
.exam-card.free-card {
  border-left: 4px solid var(--success);
}
.exam-card.pro-card {
  border-left: 4px solid var(--accent);
}
.exam-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.exam-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.exam-card-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ----------------- Dashboard Layout ----------------- */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.user-profile-banner {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.user-info-flex {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-icon.primary { background: #e0e7ff; color: #4338ca; }
.stat-icon.success { background: #dcfce7; color: #15803d; }
.stat-icon.accent { background: #fef3c7; color: #b45309; }
.stat-icon.danger { background: #fee2e2; color: #b91c1c; }

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--dark);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ----------------- Charts Grid ----------------- */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------- Table Styles ----------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 1rem;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr:hover td {
  background: #f8fafc;
}

/* ----------------- Leaderboard Podium ----------------- */
.podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.podium-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  width: 220px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.podium-card.rank-1 {
  border-top: 6px solid #eab308;
  transform: translateY(-15px);
  box-shadow: 0 10px 25px rgba(234, 179, 8, 0.2);
}
.podium-card.rank-2 {
  border-top: 6px solid #94a3b8;
}
.podium-card.rank-3 {
  border-top: 6px solid #d97706;
}
.podium-badge {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* ----------------- Modal ----------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex !important;
}
.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

/* ----------------- Toast Notifications ----------------- */
#toastContainer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--dark);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}
.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ----------------- Footer ----------------- */
.footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ========================================================= */
/* RESPONSIVE DESIGN FOR SMARTPHONES & TABLETS               */
/* ========================================================= */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

@media (max-width: 860px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 6px;
  }

  .mobile-nav-close {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    color: #475569;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }
  .mobile-nav-close:hover {
    background: #e2e8f0;
    color: #0f172a;
  }

  .nav-menu-wrapper {
    position: fixed;
    top: 0;
    right: -340px;
    width: 300px;
    max-width: 88vw;
    height: 100vh;
    background: #ffffff !important;
    box-shadow: -6px 0 30px rgba(0, 0, 0, 0.35);
    z-index: 2050;
    flex-direction: column;
    padding: 1.25rem 1.25rem 2.5rem 1.25rem;
    transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    margin-left: 0;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .nav-menu-wrapper.open {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    width: 100%;
    pointer-events: auto !important;
  }

  .nav-link {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    width: 100%;
    font-size: 0.95rem;
    color: #1e293b !important;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none;
    -webkit-tap-highlight-color: rgba(67, 56, 202, 0.1);
  }

  .nav-link:hover, .nav-link:active, .nav-link.active {
    background: #e0e7ff;
    color: #4338ca !important;
    border-color: #c7d2fe;
  }

  .nav-auth {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
    border-top: 1.5px solid var(--border);
    padding-top: 1.2rem;
  }

  .nav-auth .btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
  }

  .nav-user-name {
    text-align: center;
    padding: 0.4rem 0;
    font-weight: 700;
    color: #1e293b;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem 0.85rem;
  }

  .hero {
    padding: 1.5rem 1rem !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 1.25rem !important;
  }

  .hero h1 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  .hero-badges {
    gap: 0.4rem !important;
    margin-bottom: 1.25rem !important;
  }

  .hero-badge-item {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.7rem !important;
  }

  .section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .section-header h2 {
    font-size: 1.25rem !important;
  }

  .exams-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .exam-card {
    padding: 1rem !important;
  }

  .podium-container {
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    margin: 1.5rem 0 !important;
  }

  .podium-card {
    width: 100% !important;
    max-width: 320px !important;
    transform: none !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }

  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  .hero h1 {
    font-size: 1.2rem !important;
  }
}

