/*
|==========================================================================
| HEADER STYLES (ENHANCED DESIGN)
|==========================================================================
| Defines the navigation bar, logo, and responsive behavior for the header.
*/

header {
  /* Positioning & Layering */
  position: sticky; 
  top: 0;
  z-index: 1000;
  
  /* Colors & Background */
  background-color: var(--primary-color);
  color: var(--secondary-color);
  
  /* Visual Effects */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Increased shadow for better visibility */
}

.header-container {
  /* Layout */
  max-width: 1200px;
  display: flex;
  justify-content: space-between; 
  align-items: center; 
  
  /* Spacing */
  margin: 0 auto;
  padding: 0.75rem 2rem; /* Reduced vertical padding for compact look */
}

/* ===== Logo Section Styling ===== */
.logo {
  /* Layout */
  display: flex;
  align-items: center;
  
  /* Spacing */
  gap: 0.75rem; /* Reduced gap between icon and text */
  
  /* Link Reset */
  text-decoration: none; 
  color: inherit; 
}

.logo-icon {
  /* Sizing & Model */
  width: 50px; 
  height: 50px;
  display: block;
  
  /* Visuals & Effects */
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
  transform-origin: center;
}

.logo-icon:hover {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 200px;
}


.logo-text h1.logo-title {
  /* Typography */
  font-size: 1rem;
  font-weight: 700; 
  
  /* Spacing Reset */
  margin: 0; 
}

.logo-text p.logo-subtitle {
  /* Typography & Visual */
  font-size: 0.7rem; 
  opacity: 0.8; 
  line-height: 1.2;
  
  /* Spacing Reset */
  margin: 0; 
}


/* ===== Main Navigation ===== */
nav {
  /* Layout */
  display: flex;
  align-items: center;
  
  /* Spacing */
  gap: 1.75rem; 
}

/* Navigation Links Styling */
nav .nav-link {
  /* Reset appearance */
  background: none;
  border: none;
  text-decoration: none; 
  cursor: pointer;
  
  /* Colors */
  color: var(--secondary-color);
  
  /* Typography & Spacing */
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0; 
  
  /* Effects & Active State Setup */
  transition: all 0.3s ease-in-out;
  border-bottom: 3px solid transparent; 
}

nav .nav-link:hover,
nav .nav-link.active {
  /* Active/Hover Visuals */
  border-bottom-color: var(--primary-dark); /* Accent color on hover/active */
  color: var(--primary-dark); 
}


/* ===== Auth/Button Section ===== */
.auth-section {
  /* Layout */
  display: flex;
  align-items: center;
  
  /* Spacing */
  gap: 1rem;
}

.user-info {
  /* Typography */
  font-size: 0.9rem;
}


/* ===== Mobile Menu Button ===== */
.mobile-menu-btn {
  /* Default state (Hidden on desktop) */
  display: none;
  
  /* Reset appearance */
  background: none;
  border: none;
  cursor: pointer;
  
  /* Colors & Typography */
  color: var(--secondary-color);
  font-size: 1.75rem; 
  padding: 0.2rem;
}

/*
|--------------------------------------------------------------------------
| MEDIA QUERIES (Mobile)
|--------------------------------------------------------------------------
*/

@media (max-width: 1200px) {
  .header-container {
    /* Layout */
    flex-wrap: wrap; 
    
    /* Spacing */
    padding: 0.5rem 1rem; 
  }

  /* Default Mobile Nav State (Toggled by JS) */
  nav {
    /* Default State */
    display: none;
    
    /* Layout */
    width: 100%;
    flex-direction: column;
    
    /* Spacing & Separator */
    gap: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.5rem; 
    border-top: 1px solid rgba(0, 0, 0, 0.1); /* Separator line */
  }

  nav.active {
    display: flex; /* Menu visible when 'active' class is added by JS */
  }
  
  /* Navigation Links in Mobile View */
  nav .nav-link {
    /* Layout & Alignment */
    width: 100%; 
    text-align: center;
    
    /* Spacing & Reset */
    padding: 0.5rem 0;
    border-bottom: none; 
    background-color: transparent; 
  }
  
  nav .nav-link:hover,
  nav .nav-link.active {
    /* Hover/Active Visuals */
    border-bottom: none;
    background-color: rgba(0, 0, 0, 0.05); /* Subtle background accent */
    color: var(--secondary-color); 
  }

  .mobile-menu-btn {
    display: block; 
    order: 2; /* Set order in the flex container */
    align-self: center;
  }

  /* Adjustments for top-row alignment (Logo and Menu Button) */
  .logo {
    width: 65%; 
    order: 1;
  }
  
  /* Auth section is hidden on the smallest screens, use visibility if needed later */
  .auth-section {
    display: none; 
  }
}
@media (max-width: 768px) {

    .logo {
        width: 70%;
    }

    .logo-text h1.logo-title {
        font-size: 1rem;
        white-space: nowrap;
    }

    .logo-text p.logo-subtitle {
        font-size: 0.6rem;
    }
}
