/* ==========================================================================
   HEADER VARIABLES & BASE STYLES
   ========================================================================== */
:root {
  --light: #E2E8F0;
  --dark: #263147;
  --accent: #00BFAF;
  --shadow-medium: rgba(38, 49, 71, 0.2);
  --shadow-heavy: rgba(38, 49, 71, 0.4);
  --transition-speed: 0.3s;
}

/* Header Container */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--light);
  z-index: 9999;
  transition: all var(--transition-speed) ease-in-out;
  border-bottom: 2px solid transparent;
}

.header.sticky {
  background-color: var(--dark);
  box-shadow: 0 4px 15px var(--shadow-heavy);
  border-bottom: 2px solid var(--accent);
  padding: 5px 0;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: padding var(--transition-speed);
}

/* ==========================================================================
   LOGO STYLES
   ========================================================================== */
.logo {
  font-size: 24px;
  font-weight: 900;
  color: var(--light); 
  text-decoration: none;
  letter-spacing: 1px;
  transition: color var(--transition-speed);
  display: flex;
  align-items: center;
  gap: 6px; 
  background-color: #263147; 
  padding: -1px 12px; 
  border-radius: 8px; 
}

.logo-icon {
  width: 28px; 
  height: 28px;
  object-fit: contain; 
}

.logo-accent {
  color: var(--accent);
}

.header.sticky .logo {
  color: var(--light);
}

/* ==========================================================================
   DESKTOP NAVIGATION STYLES
   ========================================================================== */
.nav-menu {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--dark);
  font-size: 15px;
  font-weight: 700;
  position: relative;
  transition: color var(--transition-speed);
}

.header.sticky .nav-link {
  color: var(--light);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent);
  transition: width var(--transition-speed) ease;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:hover::after {
  width: 100%;
}

/* ==========================================================================
   UNIFIED ACTION BUTTONS (English & Logout)
   ========================================================================== */
.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Safe, isolated class applied to exactly English & Logout */
.header-btn-unified {
  height: 42px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin: 0;
  
  /* Base color theme (matches Logout and English) */
  background-color: transparent;
  color: var(--dark);
  border: 2px solid var(--dark);
}

/* Hover effect for base buttons */
.header-btn-unified:hover {
  background-color: var(--dark);
  color: var(--accent);
}

/* Sticky Header Base Colors */
.header.sticky .header-btn-unified {
  color: var(--light);
  border-color: var(--light);
}
.header.sticky .header-btn-unified:hover {
  background-color: var(--light);
  color: var(--dark);
}

/* Select/Dropdown Specific Reset to maintain identical height/border */
select.header-btn-unified {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 32px;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23263147" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.header.sticky select.header-btn-unified {
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23E2E8F0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
}

/* ==========================================================================
   MOBILE HAMBURGER & SLIDE MENU
   ========================================================================== */
.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  z-index: 10000;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--dark);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}
.header.sticky .bar {
  background-color: var(--light);
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--accent);
}
.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 860px) {
  .hamburger {
    display: flex;
  }
  
  .nav-actions {
    display: none; 
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%; 
    width: 280px;
    height: 100vh;
    background-color: var(--dark);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px;
    box-shadow: -5px 0 15px var(--shadow-heavy);
    transition: right 0.4s ease-in-out;
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav-list li {
    text-align: center;
    width: 100%;
  }

  /* Mobile Links Styling */
  .nav-link {
    display: block;
    padding: 16px 20px;
    color: var(--light); 
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .header.sticky .nav-link {
    color: var(--light);
  }

  .nav-link:hover {
    background-color: rgba(0, 191, 175, 0.1);
    color: var(--accent);
  }

  .nav-link::after {
    display: none; 
  }

  /* Mobile Auth Buttons Balanced & Unified */
  .mobile-auth-actions {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
    padding: 25px 20px;
  }

  /* Unified buttons scaling for mobile view */
  .mobile-auth-actions .header-btn-unified {
    width: 100%;
    height: 46px; /* Slightly taller for touch screens */
    color: var(--light);
    border-color: var(--light);
  }
  
  .mobile-auth-actions select.header-btn-unified {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23E2E8F0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
  }

  .mobile-auth-actions .header-btn-unified:hover {
    background-color: var(--light);
    color: var(--dark);
  }
}

/* ==========================================================================
   DESKTOP / MOBILE COMPATIBILITY CLASSES
   ========================================================================== */
@media (min-width: 861px) {
  .mobile-auth-actions {
    display: none !important;
  }
}

@media (max-width: 860px) {
  .desktop-auth-actions {
    display: none !important;
  }
}
