/* Header Component Styles */
/* From Figma: https://www.figma.com/design/FM37mlzkcwifBXi0YZgG4O/Untitled?node-id=1-2 */
/* SHARED WITH frontend_v2/src/styles/header.css - Keep in sync! */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px; /* Mobile default height */
  background: var(--color-header-bg);
  box-shadow: var(--shadow-header);
  z-index: var(--z-header);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 var(--container-padding-mobile); /* Mobile default padding */
}

.site-header__container {
  width: 100%;
  max-width: 1216px; /* Fixed width for navigation container */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Logo Section */
.site-header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  height: 64px; /* Logo button height from Figma layout_YQJPD3 */
  width: auto; /* Let it size naturally */
}

.site-header__logo:hover {
  text-decoration: none;
}

/* Reset font inheritance for logo children */
.site-header__logo * {
  font-family: inherit;
  font-weight: inherit;
}

.site-header__logo-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-header__logo-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-header__logo-my-events {
  font-family: var(--font-family-brand);
  font-size: 40px;
  line-height: 1em;
  background: linear-gradient(90deg, rgba(249, 115, 22, 1) 0%, rgba(249, 115, 22, 1) 50%, rgba(251, 146, 60, 1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback */
  letter-spacing: 2px;
  margin: 0;
  font-weight: 400;
}

.site-header__logo-bridge {
  font-family: var(--font-family-montserrat);
  font-weight: 300;
  font-size: 28px;
  line-height: 1em;
  color: var(--color-header-text);
  letter-spacing: 1.4px;
  margin: 0;
  margin-top: 12px;
  text-transform: uppercase;
}

/* Hamburger Menu Button - Hidden by default, shown on mobile */
.site-header__menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  gap: 5px;
}

.site-header__menu-toggle span {
  width: 100%;
  height: 2px;
  background: var(--color-header-text);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.site-header__menu-toggle--active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.site-header__menu-toggle--active span:nth-child(2) {
  opacity: 0;
}

.site-header__menu-toggle--active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Navigation - Desktop visible by default */
.site-header__nav {
  display: flex;
  gap: 16px; /* Increased spacing between nav links for better visual separation */
  align-items: center;
}

/* Desktop: Navigation spacing - same as static pages */
@media (min-width: 1025px) {
  .site-header__nav,
  .site-header__nav--desktop {
    /* No margin-left - let justify-content: space-between handle spacing */
    gap: 16px; /* Ensure gap is applied */
  }
}

/* Mobile navigation - Hidden by default */
.site-header__nav--mobile {
  display: none;
}

.site-header__nav-link {
  padding: 10px 24px; /* From Figma layout_P1GG0K, layout_YM2970, etc */
  height: 44px; /* From Figma layout_P1GG0K: height: 44 */
  border-radius: 10px; /* From Figma layout_P1GG0K: borderRadius: 10px */
  font-family: var(--font-family-montserrat);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5em;
  text-align: center;
  text-decoration: none;
  color: var(--color-header-text); /* White text for inactive links on dark background */
  transition: all 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent; /* Inactive links are transparent */
}

.site-header__nav-link:hover {
  background: var(--color-header-nav-hover);
  text-decoration: none;
  color: var(--color-header-text); /* Keep white text on hover */
}

.site-header__nav-link--active {
  background: #FFFFFF; /* White background for active link */
  color: #0F172B; /* Dark text on white background - #0F172B */
}

.site-header__nav-link--active:hover {
  background: var(--color-header-nav-active-hover);
  text-decoration: none;
  color: #0F172B; /* Keep dark text on hover - #0F172B */
}

/* Override link styles for header navigation */
.site-header a {
  color: inherit;
}

.site-header a:hover {
  text-decoration: none;
}

/* Ensure nav links are visible - using higher specificity instead of !important */
.site-header .site-header__nav-link,
.site-header .site-header__nav a {
  color: var(--color-header-text);
}

/* Active link color - using higher specificity instead of !important */
.site-header .site-header__nav-link--active,
.site-header .site-header__nav-link--active a,
.site-header .site-header__nav-link.site-header__nav-link--active,
.site-header .site-header__nav a.site-header__nav-link--active {
  color: #0F172B;
  background: #FFFFFF;
}

/* Add space to body so content doesn't hide under fixed header */
body.has-fixed-header {
  padding-top: 64px; /* Mobile default */
}

@media (min-width: 1025px) {
  body.has-fixed-header {
    padding-top: 96px; /* Desktop height from Figma */
  }
}

/* Desktop Navigation - Show above 1024px - MUST be after mobile styles */
@media (min-width: 1025px) {
  /* Desktop header height and padding from Figma - using more specific selector */
  header.site-header,
  .site-header {
    height: 96px; /* From Figma layout_EKO5RL: height: 96 */
    padding: 0 var(--container-padding-wide); /* From Figma layout_EKO5RL: padding: 0px 104px */
  }
  
  /* Hide hamburger menu on desktop */
  .site-header .site-header__menu-toggle {
    display: none;
  }
  
  /* Show desktop navigation */
  .site-header .site-header__nav--desktop {
    display: flex;
  }
  
  /* Hide mobile navigation */
  .site-header .site-header__nav--mobile {
    display: none;
  }
}

/* Responsive adjustments for medium screens */
@media (max-width: 1200px) and (min-width: 1025px) {
  .site-header {
    padding: 0 var(--container-padding);
  }
  
  .site-header__container {
    gap: 0;
  }
}

/* Tablet and Mobile - Show hamburger menu at 1024px and below */
@media (max-width: 1024px) {
  .site-header {
    height: 64px;
    top: 0;
    padding: 0 var(--container-padding-mobile);
  }
  
  .site-header__container {
    padding: 0;
    gap: 0;
  }
  
  .site-header__nav {
    margin-left: 0; /* Remove desktop spacing on mobile */
  }
  
  /* Улучшенный логотип для мобильных и планшетов */
  .site-header__logo {
    height: 48px;
    gap: 8px;
    z-index: 1001;
    width: auto; /* Remove fixed width on mobile */
  }
  
  .site-header__logo-image {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
  
  /* Mobile styles from Figma - style_W1B35J and style_1H7X5P */
  .site-header__logo-my-events {
    display: block;
    font-family: var(--font-family-brand);
    font-size: 24px;
    line-height: 1em;
    background: linear-gradient(90deg, rgba(249, 115, 22, 1) 0%, rgba(249, 115, 22, 1) 50%, rgba(251, 146, 60, 1) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    letter-spacing: 1.2px;
    font-weight: 400;
  }
  
  .site-header__logo-text {
    gap: 4px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }
  
  .site-header__logo-bridge {
    font-family: var(--font-family-montserrat);
    font-weight: 300;
    font-size: 16px;
    line-height: 1em;
    color: var(--color-header-text);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-top: 0;
  }
  
  /* Show hamburger menu on mobile - using higher specificity */
  .site-header .site-header__menu-toggle {
    display: flex;
  }
  
  /* Hide desktop navigation on mobile */
  .site-header .site-header__nav--desktop {
    display: none;
  }
  
  /* Mobile navigation - Always rendered but hidden by default */
  .site-header .site-header__nav--mobile {
    display: flex;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-header-bg);
    flex-direction: column;
    align-items: stretch;
    padding: var(--spacing-sm);
    gap: var(--spacing-xs);
    box-shadow: var(--shadow-header);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: var(--z-dropdown);
  }
  
  .site-header__nav--mobile.site-header__nav--mobile-open,
  .site-header .site-header__nav--mobile.site-header__nav--mobile-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .site-header__nav--mobile .site-header__nav-link {
    width: 100%;
    padding: 12px var(--spacing-sm);
    height: auto;
    min-height: 44px;
    justify-content: flex-start;
    border-radius: var(--spacing-xs);
    font-size: 16px;
  }
  
  .site-header__nav--mobile .site-header__nav-link:hover {
    background: var(--color-header-nav-hover);
    color: var(--color-header-text);
  }
  
  .site-header__nav--mobile .site-header__nav-link:active {
    background: var(--color-header-nav-hover);
    color: var(--color-header-text);
    transform: scale(0.98);
  }
  
  .site-header__nav--mobile .site-header__nav-link--active:hover {
    background: var(--color-header-nav-active-hover);
    color: #0F172B;
  }
  
  .site-header__nav--mobile .site-header__nav-link--active:active {
    background: var(--color-header-nav-active-hover);
    color: #0F172B;
    transform: scale(0.98);
  }
  
  body.has-fixed-header {
    padding-top: 64px;
  }
}

/* Desktop: Ensure navigation has proper height and header height */
@media (min-width: 1025px) {
  .site-header__nav {
    /* No fixed width - let it size naturally like static pages */
    height: 44px; /* From Figma layout_XE6QOV: height: 44 */
    gap: 16px; /* Ensure gap is applied on desktop */
  }
  
  /* Ensure desktop header height is 96px - placed at end for priority */
  header.site-header,
  .site-header {
    height: 96px; /* Force 96px on desktop */
  }
}

