/**
 * Site Navigation Styles
 * 
 * Professional navigation component with:
 * - Brand consistency (green theme, ✦ icon)
 * - Mobile responsive hamburger menu
 * - Smooth animations and transitions
 * - Accessibility support
 */

/* ========================================
   Navigation Container
   ======================================== */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: box-shadow 0.3s ease;
}

.site-nav:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.site-nav__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* ========================================
   Left Section (Brand + Links)
   ======================================== */

.site-nav__left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Brand/Logo */
.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 1.125rem;
  transition: color 0.2s ease;
}

.site-nav__brand:hover {
  color: #199C78;
}

.site-nav__icon {
  font-size: 1.5rem;
  color: #199C78;
  transition: color 0.2s ease;
}

.site-nav__brand:hover .site-nav__icon {
  color: #16b38a;
}

.site-nav__name {
  color: #1a1a1a;
  font-weight: 600;
}

/* Navigation Links */
.site-nav__links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav__link {
  position: relative;
  color: #4a4a4a;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.site-nav__link:hover {
  color: #199C78;
  background-color: rgba(25, 156, 120, 0.04);
}

/* Active state for current page */
.site-nav__link.active {
  color: #199C78;
  background-color: rgba(25, 156, 120, 0.08);
}

/* Button style for sign out */
.site-nav__link--button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* ========================================
   Right Section (Auth Links)
   ======================================== */

.site-nav__right {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.site-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #199C78, #16b38a);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(25, 156, 120, 0.25);
  transition: all 0.3s ease;
}

.site-nav__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(25, 156, 120, 0.35);
  background: linear-gradient(135deg, #16b38a, #199C78);
}

.site-nav__cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(25, 156, 120, 0.25);
}

.site-nav__arrow {
  transition: transform 0.3s ease;
}

.site-nav__cta:hover .site-nav__arrow {
  transform: translateX(4px);
}

/* ========================================
   Mobile Menu Toggle
   ======================================== */

.site-nav__toggle {
  display: none; /* Hidden by default, shown on mobile */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.site-nav__burger {
  width: 24px;
  height: 2px;
  background: #199C78;
  border-radius: 2px;
  transition: all 0.3s ease;
  margin: 3px 0;
}

.site-nav__toggle:hover .site-nav__burger {
  background: #16b38a;
}

/* Mobile menu open state */
.site-nav__toggle.open .site-nav__burger:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.site-nav__toggle.open .site-nav__burger:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.site-nav__toggle.open .site-nav__burger:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   Mobile Menu Dropdown
   ======================================== */

.site-nav__mobile {
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  animation: slideDown 0.3s ease;
}

.site-nav__mobile.open {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-nav__mobile-link {
  padding: 0.875rem 1rem;
  color: #4a4a4a;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: white;
  border: 1px solid rgba(25, 156, 120, 0.1);
  width: 100%;
  text-align: left;
}

.site-nav__mobile-link:hover {
  color: #199C78;
  background-color: rgba(25, 156, 120, 0.06);
  border-color: rgba(25, 156, 120, 0.2);
  transform: translateX(4px);
}

/* Button style for mobile sign out */
.site-nav__mobile-link--button {
  background: white;
  cursor: pointer;
  font-family: inherit;
  display: block;
}

.site-nav__mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #199C78, #16b38a);
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(25, 156, 120, 0.25);
  transition: all 0.3s ease;
  margin-top: 0.5rem;
}

.site-nav__mobile-cta:hover {
  background: linear-gradient(135deg, #16b38a, #199C78);
  box-shadow: 0 4px 12px rgba(25, 156, 120, 0.35);
}

/* ========================================
   Flash Messages
   ======================================== */

.flash-container {
  position: fixed;
  top: 72px; /* Below navigation */
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: 100%;
  max-width: 600px;
  padding: 0 1rem;
  animation: slideIn 0.4s ease;
}

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

.flash-message {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.75rem;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.flash-message--success {
  background: linear-gradient(135deg, rgba(25, 156, 120, 0.95), rgba(22, 179, 138, 0.95));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.flash-message--error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

@media (max-width: 768px) {
  .site-nav__container {
    height: 56px;
  }

  /* Hide desktop links and CTA on mobile */
  .site-nav__links,
  .site-nav__right {
    display: none;
  }

  /* Show mobile toggle */
  .site-nav__toggle {
    display: flex;
  }

  .site-nav__brand {
    font-size: 1rem;
  }

  .site-nav__icon {
    font-size: 1.25rem;
  }

  .flash-container {
    top: 64px;
  }
}

@media (min-width: 769px) {
  /* Ensure mobile menu is hidden on desktop */
  .site-nav__mobile {
    display: none !important;
  }
}

/* ========================================
   Accessibility
   ======================================== */

/* Focus states for keyboard navigation */
.site-nav__link:focus,
.site-nav__cta:focus,
.site-nav__brand:focus,
.site-nav__toggle:focus {
  outline: 2px solid #199C78;
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .site-nav {
    border-bottom: 2px solid #199C78;
  }

  .site-nav__link {
    border: 1px solid transparent;
  }

  .site-nav__link:hover,
  .site-nav__link.active {
    border-color: #199C78;
  }
}

/* Clean light navigation - dark mode disabled for consistent branding */

/* ========================================
   Site Footer
   ======================================== */

.site-footer {
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding: 2rem 0;
  margin-top: 4rem;
}

.site-footer__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.site-footer__text {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0 0 1rem 0;
}

.site-footer__links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.site-footer__link {
  color: #4b5563;
  text-decoration: none;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.site-footer__link:hover {
  color: #111827;
  text-decoration: underline;
}

.site-footer__divider {
  color: #d1d5db;
}
