/* ===== HEADER AND FOOTER COMPONENT STYLES ===== */

/*
HEADER AND FOOTER SYSTEM:
Provides consistent navigation and branding in header,
with multi-column link structure and copyright info in footer.

STRUCTURE:
- Header: Navigation bar with logo, links, CTA button, mobile menu
- Footer: Multi-column link sections with copyright and social links

DESIGN APPROACH:
- Header: Sticky, minimal design with clear hierarchy
- Footer: Dark background with organized link columns
- Both: Use design system colors, spacing, and typography
*/

/* ===== HEADER STYLING ===== */

/*
Header wrapper - navigation bar
Sticky positioning for persistent navigation
White background with subtle border
*/

.header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: var(--spacing-md) var(--spacing-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Navigation container - flex layout */
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* ===== LOGO STYLING ===== */

/*
Logo section - branding element
Flex layout for icon and text
*/

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 1.125rem;
  transition: opacity var(--transition-base);
}

.logo:hover {
  opacity: 0.8;
}

/* Logo icon - handshake logo image */
.logo-icon {
  height: 48px;
  width: auto;
  display: block;
  margin-right: 12px;
}

/* Logo text */
.logo-text {
  color: #1f2937;
  font-weight: 700;
  font-size: 1.124rem;
}

/* ===== NAVIGATION LINKS ===== */

/*
Navigation menu - horizontal list of links
Hidden on mobile, visible on desktop
*/

.nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--spacing-xl);
  flex: 1;
  justify-content: center;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color var(--transition-base);
}

.nav-links a:hover {
  color: #7c3aed;
}

.nav-links a:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 4px;
  border-radius: var(--border-radius-sm);
}

/* Show nav links on tablet and larger */
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* ===== NAVIGATION CTA BUTTON ===== */

/*
Navigation CTA - "Get Started" or similar button
Compact button for header navigation
Hidden on mobile, visible on desktop
*/

.nav-cta {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  padding: var(--spacing-sm) var(--spacing-md);
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: all var(--transition-base);
  min-height: 40px;
  position: relative;
}

.nav-cta:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
  box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
  transform: translateY(-1px);
}

.nav-cta:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.3);
}

.nav-cta:active {
  background: linear-gradient(135deg, #5b21b6 0%, #4c1d95 100%);
  transform: translateY(0);
  box-shadow: 0 2px 4px -1px rgba(124, 58, 237, 0.2);
}

/* Show nav CTA on tablet and larger */
@media (min-width: 768px) {
  .nav-cta {
    display: inline-flex;
  }
}

/* ===== MOBILE MENU BUTTON ===== */

/*
Mobile menu button - hamburger toggle
Shows on mobile, hidden on desktop
*/

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #1f2937;
  transition: color var(--transition-base);
}

.mobile-menu-btn:hover {
  color: #7c3aed;
}

.mobile-menu-btn:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  border-radius: var(--border-radius-md);
}

/* Hide on tablet and larger */
@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* ===== HEADER RESPONSIVE DESIGN ===== */

@media (max-width: 640px) {
  .header {
    padding: var(--spacing-md) var(--spacing-md);
  }

  .nav-container {
    padding: 0;
    gap: var(--spacing-md);
  }

  .logo-icon {
    height: 40px;
    width: auto;
  }

  .logo-text {
    font-size: 1rem;
  }
}

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

/*
Footer wrapper - multi-column layout
Dark background for visual separation
Multiple columns for content organization
*/

.footer {
  background: #1f2937;
  color: #d1d5db;
  padding: var(--spacing-4xl) var(--spacing-lg);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* Footer grid - multiple columns */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-3xl);
  margin-bottom: var(--spacing-3xl);
}

/* Footer section - column */
.footer-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* Footer logo */
.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: var(--spacing-sm);
}

.footer-logo .logo-icon {
  height: 40px;
  width: auto;
  /* White hands, purple letters from SVG */
}

.footer-logo .logo-text {
  color: #ffffff; /* White text in footer */
}

/* Footer description text */
.footer-description {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #9ca3af;
  margin: 0;
}

/* Footer section title */
.footer-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

/* Footer links list */
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color var(--transition-base);
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-links a:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
  color: #ffffff;
}

/* ===== FOOTER BOTTOM - COPYRIGHT AND SOCIAL ===== */

/*
Footer bottom section with copyright and social links
Separated by top border
*/

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  padding-top: var(--spacing-3xl);
  border-top: 1px solid #374151;
  align-items: center;
  text-align: center;
}

/* Footer copyright text */
.footer-copyright {
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0;
}

/* Footer social links */
.footer-socials {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: center;
}

.footer-socials a {
  color: #9ca3af;
  text-decoration: none;
  transition: color var(--transition-base);
  font-size: 0.9375rem;
}

.footer-socials a:hover {
  color: #ffffff;
}

.footer-socials a:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* ===== FOOTER RESPONSIVE DESIGN ===== */

@media (max-width: 640px) {
  .footer {
    padding: var(--spacing-3xl) var(--spacing-md);
    margin-top: var(--spacing-3xl);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
  }

  .footer-bottom {
    gap: var(--spacing-md);
    padding-top: var(--spacing-2xl);
  }

  .footer-socials {
    gap: var(--spacing-md);
  }

  .footer-section {
    gap: var(--spacing-sm);
  }

  .footer-description {
    font-size: 0.8125rem;
  }

  .footer-links a {
    font-size: 0.875rem;
  }

  .footer-copyright {
    font-size: 0.8125rem;
  }
}

@media (min-width: 768px) {
  .footer {
    padding: var(--spacing-4xl) var(--spacing-xl);
  }

  .footer-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-3xl);
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer-socials {
    justify-content: flex-end;
  }
}

@media (min-width: 1024px) {
  .footer {
    padding: var(--spacing-4xl) var(--spacing-xl);
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-4xl);
  }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
  .header,
  .footer,
  .logo,
  .nav-cta,
  .footer-links a {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  .header {
    border-bottom: 2px solid #1f2937;
  }

  .footer {
    border-top: 2px solid #7c3aed;
  }

  .nav-links a:hover,
  .footer-links a:hover {
    text-decoration: underline;
  }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
  .header {
    background: #1f2937;
    border-bottom-color: #374151;
  }

  .nav-links a {
    color: #d1d5db;
  }

  .nav-links a:hover {
    color: #7c3aed;
  }
}

/* ===== PRINT STYLES ===== */

@media print {
  .header,
  .mobile-menu-btn {
    display: none;
  }

  .footer {
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-2xl) 0;
    border-top: 1px solid #d1d5db;
  }
}

/* --- MOBILE MENU OVERRIDES --- */
@media (max-width: 768px) {
  .mobile-menu-btn {
    color: #7c3aed; /* Force dark color so it's visible */
    z-index: 101; /* Ensure it sits above the open menu */
    position: relative;
  }

  /* The Menu Container (Hidden by default) */
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background: white;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px; /* Space for close button */
    padding-left: 2rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%); /* Push off screen right */
    transition: transform 0.3s ease-in-out;
    z-index: 100;
  }

  /* The Class JS will add to open it */
  .nav-links.nav-active {
    transform: translateX(0%);
  }
}
