/* nav.css - Unified navbar system for all pages */
:root {
  --primary-red: #dc2626;
  --primary-black: #000000;
  --primary-white: #ffffff;
  --accent-blue: #2563eb;
  --gray-light: #f3f4f6;
  --gray-medium: #6b7280;
}

/* Base body setup for fixed navbar */
body {
  margin: 0;
  padding-top: 8rem; /* Space for fixed navbar (8rem = 128px) */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--gray-light);
  color: var(--primary-black);
  line-height: 1.6;
  min-height: 100vh;
}

/* Main navbar container */
.navbar {
  padding: 0;
  display: flex;
  position: fixed;
  top: 0;
  width: 100%;
  height: 8rem; /* Fixed height */
  background-color: var(--primary-white);
  align-items: center;
  border-top: 2px solid var(--primary-black);
  border-bottom: 2px solid var(--primary-black);
  z-index: 1000;
  box-sizing: border-box;
}

/* Inner container for content */
.navbar-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

/* Logo container */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  height: 100%;
}

/* SVG Logo styling */
.logo svg {
  height: 6rem;
  width: 6rem;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Enhanced 360° spin + scale animation */
.logo:hover svg {
  transform: rotate(360deg) scale(1.3);
}

/* SVG border styles */
.logo .logo-border {
  stroke: var(--primary-black);
  stroke-width: 2.5;
  transition: stroke 0.3s ease;
}

.logo:hover .logo-border {
  stroke: var(--primary-red);
  stroke-width: 3;
}

/* Refined pulsating beam animation */
@keyframes pulseStroke {
  0%,
  100% {
    stroke: var(--primary-black);
    stroke-width: 1.5;
  }
  50% {
    stroke: var(--primary-red);
    stroke-width: 2.2;
    opacity: 0.9;
  }
}

/* Apply animation to ALL beam paths by their IDs */
#path4002,
#path4004,
#path4006,
#path4008,
#path4010,
#path4012,
#path4014,
#path4016 {
  animation: pulseStroke 2s infinite ease-in-out;
  fill: none;
  stroke: black;
  stroke-width: 2;
}

/* Also apply to the logo-beam class */
.logo .logo-beam {
  fill: none;
  stroke: var(--primary-red);
  stroke-width: 2;
  stroke-linecap: round;
  animation: pulseStroke 2s infinite ease-in-out;
}

/* Optional: Add glow effect on hover */
.logo:hover .logo-beam {
  filter: drop-shadow(0 0 2px var(--primary-red));
}

/* Site Title */
.site-title {
  font-size: 1.5rem;
  color: var(--primary-red);
  font-weight: 700;
  margin: 0;
  transition: color 0.3s ease;
}

/* Optional: Add title color change on logo hover */
.logo:hover .site-title {
  color: var(--primary-red);
}

/* Navigation Links */
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  height: 100%;
}

.nav-links a {
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--primary-black);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-red);
  transition: width 0.3s ease;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-red);
}

/* Login/Dashboard link special styling */
.nav-link.authenticated {
  background: rgba(220, 38, 38, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-left: 1rem;
}

/* Main content container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Main content area */
main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* ===== MOBILE RESPONSIVENESS ===== */
/* Tablets (768px and below) */
@media (max-width: 768px) {
  .navbar-inner {
    padding: 0 1.5rem;
  }

  .nav-links {
    gap: 1.5rem;
  }

  .site-title {
    font-size: 1.4rem;
  }

  .logo svg {
    height: 5rem;
    width: 5rem;
  }

  .logo:hover svg {
    transform: rotate(360deg) scale(1.25);
  }
}

/* Small Tablets and Large Phones (640px and below) - NAVIGATION STACKS */
@media (max-width: 640px) {
  .navbar {
    height: auto;
    min-height: 4rem;
    position: relative;
    border-bottom: 2px solid var(--primary-black);
    margin: 0;
    padding: 0;
  }

  .navbar-inner {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
    margin: 0;
    border-bottom: none;
  }

  /* Fix mobile spacing immediately */
  @media (max-width: 640px) {
    .navbar-inner {
      justify-content: space-between !important;
      padding: 0 0.75rem !important;
    }

    .site-title {
      flex: 1; /* Take available space */
      text-align: center;
      margin: 0 0.5rem !important;
      padding: 0 0.25rem !important;
      font-size: calc(0.8rem + 0.5vw) !important; /* Responsive font size */
      white-space: nowrap; /* Prevent line breaks */
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .logo {
      flex-shrink: 0;
    }

    .nav-links {
      flex-shrink: 0;
    }
  }

  .logo {
    justify-content: center;
  }

  .logo svg {
    height: 5rem;
    width: 5rem;
  }

  /* Ensure beam animations work on mobile */
  #path4002,
  #path4004,
  #path4006,
  #path4008,
  #path4010,
  #path4012,
  #path4014,
  #path4016 {
    animation: pulseStroke 2s infinite ease-in-out;
    fill: none;
    stroke: black;
    stroke-width: 2;
  }

  .logo .logo-beam {
    fill: none;
    stroke: var(--primary-red);
    stroke-width: 2;
    stroke-linecap: round;
    animation: pulseStroke 2s infinite ease-in-out;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .nav-links a {
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid var(--primary-black);
    border-radius: 4px;
    background: var(--primary-white);
    width: 100%;
    height: auto;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: var(--primary-red);
    color: var(--primary-white);
    border-color: var(--primary-red);
  }

  body {
    padding-top: 0; /* Remove padding since navbar is no longer fixed */
  }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
  .navbar-inner {
    padding: 0.75rem;
  }

  .site-title {
    font-size: 1.3rem;
  }

  .logo svg {
    height: 4rem;
    width: 4rem;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 0.6rem;
  }

  body {
    padding-top: 5.5rem;
  }
}

/* Very Small Phones (360px and below) */
@media (max-width: 360px) {
  .navbar {
    border-bottom: 2px solid var(--primary-black);
  }

  .navbar-inner {
    padding: 0.5rem;
  }

  .site-title {
    font-size: 1.2rem;
  }

  .logo svg {
    height: 3.5rem;
    width: 3.5rem;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  body {
    padding-top: 5rem;
  }
}
/* nav.css - ADD THIS AT THE VERY END */

/* ===== FIX VERTICAL ALIGNMENT ===== */
/* Ensure consistent vertical centering across all pages */
.site-title {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  position: relative !important;
  top: 0 !important;
}

/* Fix any positioning issues */
.navbar-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 100% !important;
}

/* Make all navbar children align consistently */
.logo,
.site-title,
.nav-links {
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
}

/* Remove any transforms or positions causing shifts */
.site-title {
  transform: none !important;
}

/* ===== FIX: Remove red line from navbar title ONLY ===== */
/* (Your existing red line fix goes here) */
.navbar .site-title::after,
header h1.site-title::after,
.navbar-inner h1.site-title::after {
  display: none !important;
  content: none !important;
  background: none !important;
  height: 0 !important;
  width: 0 !important;
}
