/* Component Styles */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, hsl(270 80% 55%) 0%, hsl(320 85% 50%) 100%);
  color: white;
  box-shadow: 0 8px 30px hsl(270 80% 60% / 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px hsl(270 80% 60% / 0.4);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
}

.btn-secondary:hover:not(:disabled) {
  background: hsl(var(--secondary) / 0.8);
}

.btn-outline {
  background: transparent;
  color: hsl(var(--primary));
  border: 2px solid hsl(var(--primary));
}

.btn-outline:hover:not(:disabled) {
  background: hsl(var(--primary));
  color: white;
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover:not(:disabled) {
  background: hsl(var(--muted));
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Mobile button optimizations */
@media (max-width: 767px) {
  .btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
}

/* Cards */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: hsl(var(--secondary));
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.2);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.5s;
  background: hsl(0 0% 100% / 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header.scrolled {
  background: hsl(0 0% 100% / 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  position: relative;
  z-index: 101;
  gap: 1rem;
  min-width: 0; /* Allow flex items to shrink */
  width: 100%;
}

.header-content > * {
  flex-shrink: 0;
}

.header-content .logo {
  flex-shrink: 1;
  min-width: 0;
  max-width: calc(100% - 4rem); /* Reserve space for hamburger */
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  min-width: 0;
  overflow: hidden;
}

.logo span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, hsl(270 80% 55%) 0%, hsl(320 85% 50%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px hsl(270 80% 60% / 0.3);
}

.nav {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav {
    display: flex;
  }
}

.nav-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s;
}

.nav-link:hover {
  color: hsl(var(--foreground));
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, hsl(270 80% 55%) 0%, hsl(320 85% 50%) 100%);
  transition: width 0.3s;
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: hsl(var(--foreground));
  z-index: 100;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  transition: background-color 0.2s;
  margin-left: auto;
}

.mobile-menu-toggle:hover {
  background: hsl(var(--secondary));
}

.mobile-menu-toggle:active {
  background: hsl(var(--secondary) / 0.8);
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  display: block;
  pointer-events: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Mobile-specific header optimizations */
@media (max-width: 767px) {
  .header-content {
    padding: 0.75rem 0;
    gap: 0.5rem;
  }
  
  .logo {
    font-size: 1.125rem;
    gap: 0.5rem;
  }
  
  .logo-icon {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
  }
  
  .logo span {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .header-content .logo {
    max-width: calc(100% - 3.5rem); /* Reserve space for hamburger on mobile */
  }
  
  /* Hide desktop navigation on mobile */
  .header-content .nav {
    display: none !important;
  }
  
  /* Hide CTA buttons container on mobile - they're in the mobile menu */
  .header-content > .nav:last-of-type,
  .header-content > div.nav,
  .header-content .header-cta-buttons {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
  
  /* Ensure hamburger is always visible and properly positioned */
  .mobile-menu-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    order: 999; /* Ensure it's always last */
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 102;
  }
  
  /* Prevent header overflow but allow hamburger to show */
  .header-content {
    overflow: visible;
  }
  
  /* Reduce container padding on mobile for more space */
  .header .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Extra small devices (iPhone SE - 320px) */
@media (max-width: 374px) {
  .header .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .header-content {
    gap: 0.375rem;
    padding: 0.625rem 0;
  }
  
  .logo span {
    max-width: 100px;
    font-size: 1rem;
  }
  
  .logo-icon {
    width: 1.75rem;
    height: 1.75rem;
  }
  
  .header-content .logo {
    max-width: calc(100% - 3rem); /* Reserve space for smaller hamburger */
  }
  
  .mobile-menu-toggle {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0.375rem;
  }
  
  .mobile-menu-toggle svg {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 768px) {
  .mobile-menu-toggle {
    display: none !important;
  }
  
  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
    visibility: hidden !important;
  }
}

/* Mobile menu overlay – above all content (hero, etc.) */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile menu panel – Nigerian-themed, above overlay; top panel so overlay remains tappable */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 100vw;
  max-height: 85vh;
  overflow: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-24px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.35s ease,
              transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Close button – top-right, large touch target */
.mobile-menu-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mobile-menu-close:hover,
.mobile-menu-close:active {
  background: rgba(147, 51, 234, 0.3);
  color: #9333EA;
}

.mobile-menu-close svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Nav + CTAs container */
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5.5rem 1.5rem 1.5rem;
  flex: 1;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 1rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-link:hover,
.mobile-menu-link:active,
.mobile-menu-link.active {
  background: rgba(147, 51, 234, 0.2);
  color: #9333EA;
}

.mobile-menu-cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-btn-ghost {
  width: 100%;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.mobile-menu-btn-ghost:hover,
.mobile-menu-btn-ghost:active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(147, 51, 234, 0.5);
}

.mobile-menu-btn-primary {
  width: 100%;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #9333EA 0%, #EC4899 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.mobile-menu-btn-primary:hover,
.mobile-menu-btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(147, 51, 234, 0.45);
}

/* Prevent body scroll when menu is open */
body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Footer */
.footer {
  background: hsl(var(--foreground));
  color: hsl(0 0% 100% / 0.8);
  padding: 5rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, hsl(270 80% 60% / 0.5), transparent);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-brand {
  grid-column: span 2;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  color: white;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
}

.footer-description {
  color: hsl(0 0% 100% / 0.7);
  margin-bottom: 1.5rem;
  max-width: 300px;
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-link {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: hsl(0 0% 100% / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: all 0.3s;
}

.social-link:hover {
  background: hsl(var(--primary));
  transform: translateY(-2px);
}

.footer-section h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: white;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: hsl(0 0% 100% / 0.6);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid hsl(0 0% 100% / 0.1);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
  }
}

.footer-copyright {
  color: hsl(0 0% 100% / 0.5);
  font-size: 0.875rem;
}

.back-to-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(0 0% 100% / 0.5);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s;
  background: none;
  border: none;
  cursor: pointer;
}

.back-to-top:hover {
  color: white;
}

/* Section */
.section {
  padding: 6rem 0;
  position: relative;
}

@media (min-width: 768px) {
  .section {
    padding: 8rem 0;
  }
}

.section-header {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto 4rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: hsl(var(--secondary));
  color: hsl(var(--primary));
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: hsl(var(--foreground));
}

@media (min-width: 640px) {
  .section-title {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 3.5rem;
  }
}

.section-description {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
}

/* Grid */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
