/* ============================================================
   COMPONENTS.CSS — Reusable UI Components
   ============================================================ */

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  padding: var(--space-4) 0;
  transition: all var(--transition-base);
}
.navbar.scrolled {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: var(--space-3) 0;
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar__logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-white);
  letter-spacing: var(--letter-spacing-tight);
}
.navbar__logo span { color: var(--color-teal-light); }
.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.navbar__links a {
  color: rgba(255,255,255,0.7);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
  position: relative;
}
.navbar__links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--color-teal-light);
  transition: width var(--transition-base);
  border-radius: var(--radius-full);
}
.navbar__links a:hover,
.navbar__links a.active {
  color: var(--color-white);
}
.navbar__links a:hover::after,
.navbar__links a.active::after {
  width: 100%;
}
.navbar__cta {
  background: var(--gradient-teal) !important;
  color: var(--color-white) !important;
  padding: var(--space-2) var(--space-6) !important;
  border-radius: var(--radius-full) !important;
  font-weight: var(--font-weight-semibold) !important;
  font-size: var(--font-size-sm) !important;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast) !important;
}
.navbar__cta::after { display: none !important; }
.navbar__cta:hover {
  transform: translateY(-1px) !important;
  box-shadow: var(--shadow-glow-teal) !important;
}

/* Mobile Menu Toggle */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
}
.navbar__toggle span {
  width: 24px; height: 2px;
  background: var(--color-white);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}
.navbar__toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.navbar__toggle.open span:nth-child(2) { opacity: 0; }
.navbar__toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .navbar__toggle { display: flex; }
  .navbar__links {
    position: fixed;
    top: 0; right: -100%;
    width: 75%; height: 100vh;
    background: var(--color-navy);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-8);
    transition: right var(--transition-slow);
    box-shadow: var(--shadow-2xl);
  }
  .navbar__links.open { right: 0; }
  .navbar__links a { font-size: var(--font-size-lg); }
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
}
.btn--primary {
  background: var(--gradient-teal);
  color: var(--color-white);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-teal);
  color: var(--color-white);
}
.btn--secondary {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,0.3);
}
.btn--secondary:hover {
  border-color: var(--color-teal-light);
  color: var(--color-teal-light);
  transform: translateY(-2px);
}
.btn--orange {
  background: var(--gradient-orange);
  color: var(--color-white);
}
.btn--orange:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-orange);
  color: var(--color-white);
}
.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--font-size-lg);
}

/* ── Cards ── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-teal);
  opacity: 0;
  transition: opacity var(--transition-base);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}
.card:hover::before { opacity: 1; }
.card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
  display: block;
}
.card__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
  margin-bottom: var(--space-3);
}
.card__text {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
}

/* Dark card variant */
.card--dark {
  background: var(--color-navy-light);
  border-color: rgba(255,255,255,0.05);
}
.card--dark .card__title { color: var(--color-white); }
.card--dark .card__text { color: var(--color-text-muted); }

/* ── Timeline ── */
.timeline {
  position: relative;
  padding: var(--space-8) 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--color-teal), var(--color-orange));
  transform: translateX(-50%);
  border-radius: var(--radius-full);
}
.timeline__item {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-12);
  position: relative;
}
.timeline__item:nth-child(odd) { flex-direction: row; }
.timeline__item:nth-child(even) { flex-direction: row-reverse; }
.timeline__dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-teal);
  border: 4px solid var(--color-navy);
  z-index: 2;
  box-shadow: var(--shadow-glow-teal);
}
.timeline__item:nth-child(even) .timeline__dot { background: var(--color-orange); box-shadow: var(--shadow-glow-orange); }
.timeline__content {
  width: 45%;
  background: var(--color-navy-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.timeline__content:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.timeline__year {
  display: inline-block;
  background: var(--gradient-teal);
  color: var(--color-white);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
}
.timeline__item:nth-child(even) .timeline__year { background: var(--gradient-orange); }
.timeline__content h3 { color: var(--color-white); font-size: var(--font-size-xl); margin-bottom: var(--space-3); }
.timeline__content p { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.timeline__image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

@media (max-width: 768px) {
  .timeline::before { left: 20px; }
  .timeline__item,
  .timeline__item:nth-child(even) { flex-direction: row; padding-left: var(--space-12); }
  .timeline__dot { left: 20px; }
  .timeline__content { width: 100%; }
}

/* ── Stats ── */
.stat {
  text-align: center;
  padding: var(--space-6);
}
.stat__number {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.stat__number--teal { color: var(--color-teal-light); }
.stat__number--orange { color: var(--color-orange); }
.stat__label {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  color: var(--color-text-muted);
}

/* ── Forms ── */
.form-group {
  margin-bottom: var(--space-6);
}
.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-navy);
  margin-bottom: var(--space-2);
}
.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-surface-dark);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  color: var(--color-text);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,0.15);
}
.form-control--error { border-color: #EF4444; }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-error {
  font-size: var(--font-size-xs);
  color: #EF4444;
  margin-top: var(--space-1);
  display: none;
}
.form-error.visible { display: block; }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}
.badge--teal { background: var(--color-teal-100); color: var(--color-teal-dark); }
.badge--orange { background: var(--color-orange-100); color: var(--color-orange-dark); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  z-index: var(--z-toast);
  transform: translateY(120%);
  transition: transform var(--transition-spring);
  font-size: var(--font-size-sm);
  max-width: 400px;
  border-left: 4px solid var(--color-teal);
}
.toast.visible { transform: translateY(0); }
.toast--error { border-left-color: #EF4444; }
.toast--success { border-left-color: var(--color-teal); }

/* ── Get Involved Page ── */
.involvement-section {
  padding: var(--space-20) 0;
  text-align: center;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#reveal-involvement {
  transition: all var(--transition-slow);
}

.involvement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
  max-width: 900px;
  width: 100%;
  margin-top: var(--space-12);
  perspective: 1000px;
  display: none; /* Hidden initially */
}

.involvement-grid.is-visible {
  display: grid;
  animation: fadeInContainer 0.5s ease forwards;
}

.involvement-card {
  opacity: 0;
  transform: translateY(40px) rotateX(-10deg);
  transition: all var(--transition-slow);
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.involvement-grid.is-visible .involvement-card {
  animation: revealCard 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.involvement-grid.is-visible .involvement-card:nth-child(2) {
  animation-delay: 0.2s;
}

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

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

.involvement-card__icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-6);
  background: var(--color-teal-50);
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-teal);
}

.involvement-card:nth-child(2) .involvement-card__icon {
  background: var(--color-orange-50);
  color: var(--color-orange);
}

.involvement-card h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
  margin-bottom: var(--space-4);
}

.involvement-card p {
  color: var(--color-text-light);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-8);
}
