/* ============================================================
   Canada PC28 Prediction - Main Stylesheet
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --indigo-900: #312e81;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Global Reset & Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-800);
  background-color: var(--white);
  overflow-x: hidden;
  line-height: 1.7;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--indigo-500), var(--indigo-600));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--indigo-600), var(--indigo-700));
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--indigo-500) var(--gray-100);
}

/* ---------- Glass Navbar ---------- */
.navbar-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  transition: var(--transition-base);
}

.navbar-glass.scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  border-bottom-color: rgba(229, 231, 235, 0.8);
}

.nav-link {
  position: relative;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--indigo-500), var(--indigo-600));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ---------- Mobile Menu ---------- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.mobile-menu.open {
  max-height: 500px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: var(--transition-base);
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Gradient Text ---------- */
.gradient-text {
  background: linear-gradient(135deg, var(--indigo-600) 0%, #7c3aed 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-light {
  background: linear-gradient(135deg, var(--indigo-400) 0%, #a78bfa 50%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Gradient Button ---------- */
.btn-gradient {
  background: linear-gradient(135deg, var(--indigo-600) 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.35);
}

.btn-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #7c3aed 0%, var(--indigo-600) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.btn-gradient:hover::before {
  opacity: 1;
}

.btn-gradient span {
  position: relative;
  z-index: 1;
}

.btn-outline {
  border: 2px solid var(--indigo-600);
  color: var(--indigo-600);
  background: transparent;
  font-weight: 600;
  transition: var(--transition-base);
}

.btn-outline:hover {
  background: var(--indigo-600);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(79, 70, 229, 0.25);
}

/* ---------- Feature Cards ---------- */
.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--indigo-500), #7c3aed);
  border-radius: 0 0 4px 4px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--indigo-200);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--indigo-50), var(--indigo-100));
  color: var(--indigo-600);
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  transition: var(--transition-base);
}

.feature-card:hover .feature-icon {
  background: linear-gradient(135deg, var(--indigo-600), #7c3aed);
  color: #fff;
  transform: scale(1.1) rotate(-5deg);
}

/* ---------- Stats Counter ---------- */
.stat-number {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--indigo-600), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

/* ---------- Testimonial Cards ---------- */
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  padding: 2rem;
  transition: var(--transition-base);
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 20px;
  font-size: 5rem;
  font-family: Georgia, serif;
  color: var(--indigo-100);
  line-height: 1;
  pointer-events: none;
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--indigo-200);
}

.star-rating {
  color: #f59e0b;
  letter-spacing: 2px;
}

/* ---------- FAQ Accordion ---------- */
.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--white);
  transition: var(--transition-base);
}

.faq-item.active {
  border-color: var(--indigo-200);
  box-shadow: var(--shadow-md);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--gray-800);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: var(--indigo-600);
}

.faq-icon {
  font-size: 1.25rem;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--gray-400);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--indigo-600);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}

.faq-answer-inner {
  padding: 0 1.5rem 1.5rem;
  color: var(--gray-600);
  line-height: 1.8;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--indigo-600) 0%, #7c3aed 50%, #6d28d9 100%);
  border-radius: 1.5rem;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  top: -80px;
  right: -60px;
}

.cta-banner::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  bottom: -60px;
  left: -40px;
}

/* ---------- Team Cards ---------- */
.team-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  overflow: hidden;
  transition: var(--transition-base);
}

.team-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.team-card:hover .team-img-overlay {
  opacity: 1;
}

.team-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(79, 70, 229, 0.85) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.25rem;
}

.team-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  margin: 0 4px;
  transition: background 0.2s ease;
}

.team-social:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--indigo-500), #7c3aed, #a855f7);
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 2px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--indigo-600);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--indigo-200);
}

.timeline-year {
  display: inline-block;
  background: linear-gradient(135deg, var(--indigo-600), #7c3aed);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ---------- Contact Form ---------- */
.form-input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--gray-200);
  border-radius: 0.75rem;
  font-size: 1rem;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: var(--transition-base);
  outline: none;
}

.form-input:focus {
  border-color: var(--indigo-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.success {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.error-message.visible {
  display: block;
}

/* ---------- Fade-In Animation (IntersectionObserver) ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }
.fade-in-delay-5 { transition-delay: 0.5s; }
.fade-in-delay-6 { transition-delay: 0.6s; }

/* ---------- Footer ---------- */
.footer-link {
  color: var(--gray-400);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--indigo-400);
}

/* ---------- Page Hero (About / Contact) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--indigo-50) 0%, #ede9fe 50%, #faf5ff 100%);
  padding-top: 7rem;
  padding-bottom: 4rem;
}

/* ---------- Contact Info Items ---------- */
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.contact-info-item:last-child {
  border-bottom: none;
}

.contact-info-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--indigo-50), var(--indigo-100));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--indigo-600);
  font-size: 1.125rem;
  flex-shrink: 0;
}

/* ---------- Responsive Media Queries ---------- */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .stat-number {
    font-size: 2.25rem;
  }

  .feature-card {
    padding: 1.5rem 1.25rem;
  }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  /* Navbar */
  .navbar-glass {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  /* Hero */
  .hero-content {
    text-align: center;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-image {
    margin-top: 2.5rem;
  }

  /* Feature cards - stack to 1 column */
  .features-grid {
    grid-template-columns: 1fr !important;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  /* Testimonials */
  .testimonial-card {
    padding: 1.5rem;
  }

  /* FAQ */
  .faq-question {
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
  }

  /* About page */
  .team-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Contact page */
  .contact-grid {
    grid-template-columns: 1fr !important;
  }

  .contact-info-sidebar {
    margin-top: 2rem;
  }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }

  .hero-subtitle {
    font-size: 1rem !important;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

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

  .stat-number {
    font-size: 1.75rem;
  }

  .team-grid {
    grid-template-columns: 1fr !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .page-hero {
    padding-top: 5rem;
    padding-bottom: 2.5rem;
  }

  .gradient-text {
    font-size: 1.75rem !important;
  }
}

/* ---------- Utility: Container max-width override for large screens ---------- */
@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .navbar-glass,
  .mobile-menu,
  .hamburger,
  .cta-banner {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
}
