/* Header CSS - Racing Future Academy */

/* Force border-box dla elementów nawigacji */
.nav-link,
.nav-text,
.mobile-menu-button,
.mobile-menu,
.mobile-menu *,
.nav-link *,
.nav-text *,
.mobile-menu-button *,
.nav-link *::before,
.nav-link *::after,
.nav-text *::before,
.nav-text *::after,
.mobile-menu-button *::before,
.mobile-menu-button *::after {
  box-sizing: border-box !important;
}

/* === FIXED HEADER === */
.header-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px; /* Mobile first */
  background-color: var(--light-gray);
  z-index: 1000;
  border-bottom: 1px solid rgba(38, 39, 40, 0.1);
  transition: all var(--transition-normal);
}

/* Desktop */
@media (min-width: 1400px) {
  .header-fixed {
    height: 99px;
  }
}

/* Header container - używa globalnej klasy .container z dodatkowymi stylami */
.header-fixed .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Override Bootstrap na mobile dla header */
  padding: 0 16px !important; /* Mobile: mniejszy padding */
}

/* Tablet */
@media (min-width: 768px) {
  .header-fixed .container {
    padding: 0 24px !important; /* Override dla tablet */
  }
}

/* Desktop */
@media (min-width: 1400px) {
  .header-fixed .container {
    padding: 0 48px !important; /* Override dla desktop */
  }
}

/* === LOGO === */
.header-logo {
  display: flex;
  align-items: center;
}

.header-logo a {
  text-decoration: none;
  display: block;
}

.logo-image {
  height: 40px;
  width: auto;
  transition: opacity 0.3s ease;
}

.logo-image:hover {
  opacity: 0.8;
}

.header-logo .logo-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-logo .logo-racing-future {
  margin-bottom: 2px;
}

.header-logo .logo-text-racing {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 24px;
  color: var(--dark-gray);
  line-height: 1;
}

.header-logo .logo-text-academy {
  font-family: var(--font-headings);
  font-weight: 500;
  font-size: 12px;
  color: var(--primary-red);
  line-height: 1;
}

/* === NAVIGATION === */
.header-nav {
  display: none; /* Hidden on mobile */
}

/* Desktop */
@media (min-width: 1400px) {
  .header-nav {
    display: flex;
    align-items: center;
    gap: 16px; /* Zmniejszony gap między menu a language selector */
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-language-selector {
  display: flex;
  align-items: center;
  gap: 16px;
}

.language-divider {
  width: 2px;
  height: 24px;
  background-color: var(--dark-gray);
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: var(--dark-gray);
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 16px; /* Dopasowany do button */
  line-height: 44px; /* Dopasowany do min-height button medium */
  min-height: 44px; /* Taka sama wysokość jak button medium */
  display: flex;
  align-items: center; /* Wyśrodkowanie w pionie */
  justify-content: center; /* Wyśrodkowanie w poziomie */
  text-transform: uppercase; /* Wielkie litery */
  position: relative; /* Dla pozycjonowania underline */
  transition: color var(--transition-normal);
}

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

.nav-text {
  margin: 0; /* Usunięcie marginesu - tekst wyśrodkowany przez line-height */
}

.nav-underline {
  position: absolute;
  bottom: 8px; /* Pozycjonuj na dole nav-link */
  left: 50%;
  transform: translateX(-50%); /* Wyśrodkuj poziomo */
  width: 5px;
  height: 2px;
  background-color: var(--primary-red);
  border-radius: 1px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.nav-link:hover .nav-underline {
  opacity: 1;
}

/* Mobile responsive dla nav-link */
@media (max-width: 1199px) {
  .nav-link {
    line-height: 40px; /* Dopasowany do button mobile min-height */
    min-height: 40px; /* Taka sama wysokość jak button medium na mobile */
  }
}

/* === LANGUAGE SELECTOR === */
.language-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.language-selector-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--dark-gray);
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 0;
  transition: all var(--transition-normal);
}

.language-selector-button:hover {
  background-color: transparent;
}

.current-language {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-icon {
  width: 25px;
  height: 25px;
}

.language-code {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 20px;
  line-height: 18.4px;
  color: var(--dark-gray);
}

.dropdown-arrow {
  transition: transform var(--transition-normal);
  color: var(--dark-gray);
}

.dropdown-arrow.open {
  transform: rotate(180deg);
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--white);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  min-width: 80px;
  z-index: 1001;
}

.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 16px;
  color: var(--dark-gray);
  cursor: pointer;
  transition: background-color var(--transition-normal);
}

.language-option:hover:not(:disabled) {
  background-color: rgba(230, 34, 66, 0.05);
}

.language-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.language-option.active {
  background-color: rgba(230, 34, 66, 0.1);
  color: var(--primary-red);
}

.language-option .check-icon {
  color: var(--primary-red);
  width: 16px;
  height: 16px;
}

/* === MOBILE NAVIGATION === */
.mobile-menu-button {
  display: block; /* Pokazuj na mobile */
  background: none;
  border: none;
  color: var(--dark-gray);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all var(--transition-normal);
}

/* Desktop - ukryj hamburger */
@media (min-width: 1400px) {
  .mobile-menu-button {
    display: none;
  }
}

.mobile-menu-button:hover {
  background-color: rgba(38, 39, 40, 0.05);
}

.mobile-menu {
  position: fixed;
  top: 79px; /* Dopasowane do wysokości header na mobile */
  left: 0;
  width: 100%;
  height: calc(100vh - 79px);
  background-color: var(--white);
  z-index: 999;
  animation: slideDown 0.3s ease-out;
}

/* Desktop - menu powinno być na wysokości desktop header */
@media (min-width: 1400px) {
  .mobile-menu {
    top: 99px;
    height: calc(100vh - 99px);
  }
}

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

.mobile-menu-content {
  padding: 48px 24px;
}

.mobile-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.mobile-nav-link {
  text-decoration: none;
  color: var(--dark-gray);
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase; /* Wielkie litery też na mobile */
  padding: 16px;
  border-radius: 8px;
  transition: all var(--transition-normal);
}

.mobile-nav-link:hover {
  color: var(--primary-red);
  background-color: rgba(230, 34, 66, 0.05);
}

.mobile-nav-button {
  text-align: center;
  margin-top: 16px;
}

/* === BODY PADDING FOR FIXED HEADER === */
body {
  padding-top: 80px; /* Mobile first */
}

/* Desktop */
@media (min-width: 1400px) {
  body {
    padding-top: 99px;
  }
}

/* === HEADER SCROLL BEHAVIOR === */
.header-fixed.scrolled {
  box-shadow: var(--shadow-md);
  background-color: rgba(249, 249, 249, 0.95);
  backdrop-filter: blur(10px);
}

/* === ACCESSIBILITY === */
.nav-link:focus,
.language-button:focus,
.mobile-menu-button:focus {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
}

/* === SMOOTH TRANSITIONS === */
.header-fixed,
.nav-link,
.language-button,
.mobile-menu-button {
  transition: all var(--transition-normal);
}
