/* ===========================
   RepoMed - Global Styles
   =========================== */

@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap");

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

:root {
  --gradient-start: #1a2a8e;
  --gradient-end: #9b59d0;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --accent-blue: #3b5bdb;
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-hero: 0 8px 32px rgba(0, 0, 0, 0.12);
  --radius-pill: 9999px;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-display: "Sora", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===========================
   HERO SECTION
   =========================== */

.hero {
  background: linear-gradient(
    135deg,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 0 0 60px 0;
  margin-bottom: 52px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 70% 50%,
      rgba(180, 130, 255, 0.18) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 20% 80%,
      rgba(100, 150, 255, 0.12) 0%,
      transparent 50%
    );
  pointer-events: none;
}

/* ===========================
   NAV BAR (PILL)
   =========================== */

.nav-pill {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 10px 14px 10px 20px;
  margin: 24px 28px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-hero);
  position: relative;
  z-index: 10;
  gap: 16px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: -0.2px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--gradient-start);
  transition: color 0.2s ease;
}

/* Center Navigation */
.nav-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  min-width: 200px;
}

.nav-link {
  background: none;
  border: none;
  color: var(--gray-700);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--accent-blue);
  background: rgba(59, 91, 219, 0.08);
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--gray-900);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
  white-space: nowrap;
}

.btn-dark:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

/* ===========================
   HERO CONTENT
   =========================== */

.hero-content {
  text-align: center;
  padding: 56px 24px 0 24px;
  position: relative;
  z-index: 5;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 10vw, 108px);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 32px;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.hero-subtitle strong {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
}

/* ===========================
   MAIN CONTAINER
   =========================== */

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   SECTION HEADING
   =========================== */

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -0.5px;
}

/* ===========================
   SUBJECT GRID
   =========================== */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 64px;
}

.subject-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--gray-900);
  box-shadow: var(--shadow-card);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
  border-color: #c4b5fd;
}

.subject-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}

.subject-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-900);
  letter-spacing: -0.1px;
}

/* ===========================
   SEARCH BAR
   =========================== */

.search-wrapper {
  margin-bottom: 36px;
}

.search-bar {
  width: 100%;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--gray-700);
  background: var(--white);
  box-shadow: var(--shadow-card);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.search-bar::placeholder {
  color: var(--gray-400);
}

.search-bar:focus {
  border-color: #a78bfa;
  box-shadow:
    0 0 0 4px rgba(167, 139, 250, 0.12),
    var(--shadow-card);
}

/* ===========================
   QUESTION CARDS
   =========================== */

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 64px;
}

.question-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--gray-100);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
}

.question-card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.question-card-body {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--gray-500);
  line-height: 1.65;
  margin-bottom: 14px;
}

.question-tag {
  display: inline-flex;
  align-items: center;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  letter-spacing: 0.1px;
}

/* ===========================
   FOOTER
   =========================== */

.footer {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  margin-top: auto;
}

.footer-text {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--gray-500);
  font-weight: 400;
}

.footer-link {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #6d28d9;
}

/* ===========================
   PAGE WRAPPER
   =========================== */

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-body {
  flex: 1;
}

/* ===========================   AUTHENTICATION MODAL
   =========================== */

.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: slideIn 0.3s ease-out;
}

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

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--gray-500);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.auth-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.auth-form {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.auth-form.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-form h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-900);
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 91, 219, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 91, 219, 0.3);
}

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

.btn-google {
  width: 100%;
  padding: 12px 16px;
  background: var(--white);
  color: var(--gray-900);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.btn-google:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.google-icon {
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--gray-400);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.auth-footer {
  text-align: center;
  font-size: 13px;
  color: var(--gray-600);
}

.auth-link {
  background: none;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  font-weight: 600;
  transition: color 0.2s ease;
  padding: 0;
  font-family: var(--font-body);
  font-size: 13px;
}

.auth-link:hover {
  color: var(--gradient-start);
  text-decoration: underline;
}

/* ===========================
   USER MENU
   =========================== */

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.user-menu.hidden {
  display: none;
}

.user-email {
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  white-space: nowrap;
  background: rgba(59, 91, 219, 0.08);
  border-radius: var(--radius-md);
}

.logout-link {
  background: var(--gray-900);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-link:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

/* ===========================
   ABOUT US MODAL
   =========================== */

.about-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.about-modal.active {
  display: flex;
}

.about-modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  position: relative;
  animation: slideIn 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

.about-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--gray-500);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.about-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.about-modal-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.about-intro {
  color: var(--gray-600);
  font-size: 16px;
  margin-bottom: 28px;
}

.about-content {
  margin-bottom: 28px;
}

.about-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-top: 20px;
  margin-bottom: 12px;
}

.about-content p {
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.features-list li {
  color: var(--gray-700);
  font-size: 14px;
  margin-bottom: 12px;
  padding-left: 0;
  line-height: 1.6;
}

.about-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-600) !important;
  font-size: 13px !important;
}

/* ===========================   RESPONSIVE - TABLET
   =========================== */

@media (max-width: 860px) {
  .subject-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: clamp(52px, 12vw, 80px);
    letter-spacing: -2px;
  }

  .nav-pill {
    margin: 20px 20px 0 20px;
    padding: 10px 12px;
  }

  .nav-brand {
    font-size: 14px;
  }

  .nav-center {
    gap: 10px;
    min-width: auto;
    flex: 1;
  }

  .nav-link {
    font-size: 13px;
    padding: 6px 12px;
  }

  .about-modal-content {
    padding: 32px 24px;
    max-width: calc(100% - 40px);
  }
}

/* ===========================
   RESPONSIVE - MOBILE
   =========================== */

@media (max-width: 520px) {
  .subject-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 52px;
    letter-spacing: -2px;
  }

  .hero-content {
    padding: 40px 16px 0 16px;
  }

  .hero {
    margin-bottom: 36px;
    padding-bottom: 44px;
  }

  .nav-pill {
    margin: 16px 8px 0 8px;
    padding: 8px 8px;
    gap: 6px;
  }

  .nav-brand {
    font-size: 11px;
  }

  .nav-center {
    gap: 4px;
    min-width: auto;
  }

  .nav-link {
    font-size: 11px;
    padding: 4px 6px;
  }

  .btn-dark {
    padding: 8px 14px;
    font-size: 13px;
  }

  .about-modal-content {
    padding: 28px 20px;
    max-width: calc(100% - 30px);
  }

  .about-modal-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
  }

  .about-content h3 {
    font-size: 16px;
    margin-top: 16px;
  }

  .about-content p,
  .features-list li {
    font-size: 13px;
  }

  .user-menu {
    gap: 4px;
    flex-shrink: 0;
  }

  .user-menu-btn {
    font-size: 12px;
    padding: 4px 8px;
  }

  .user-menu-dropdown {
    right: -5px;
  }

  .container {
    padding: 0 16px;
  }

  .footer {
    padding: 16px 20px;
  }

  .question-card {
    padding: 18px 18px;
  }

  .auth-modal-content {
    padding: 32px 24px;
    max-width: calc(100% - 40px);
  }
}
