/* ===================== HEADER COMPONENT STYLES ===================== */

/* CSS Variables para o Header */
:root {
  --header-height: 85px;
  --header-bg: var(--white);
  --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  --header-padding: 1rem 0;
  --header-z-index: 1000;
  
  /* Navigation */
  --nav-gap: 2rem;
  --nav-link-padding: 0.5rem 1rem;
  --nav-link-border-radius: 6px;
  --nav-link-transition: all 0.3s ease;
  
  /* Logo */
  --logo-height: 60px;
  --logo-gap: 1rem;
  
  /* Mobile Menu */
  --mobile-menu-width: 280px;
  --mobile-menu-bg: var(--white);
  --mobile-menu-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
  --mobile-btn-size: 40px;
  --mobile-overlay-bg: rgba(0, 0, 0, 0.5);
}

/* ===================== BASE HEADER STYLES ===================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  box-shadow: var(--header-shadow);
  z-index: var(--header-z-index);
  transition: var(--nav-link-transition);
}

/* Body offset para compensar o header fixo */
body {
  padding-top: var(--header-height) !important;
}

/* Ajuste para primeira seção após header fixo */
.header + main > section:first-child,
.header + main > .hero:first-child {
  margin-top: 0;
  position: relative;
}

/* Ajuste específico para hero sections com padding interno */
.hero {
  padding-top: calc(var(--header-height) * 0.3);
}

/* Utility classes para ajustes específicos */
.header-offset-top {
  margin-top: var(--header-height) !important;
}

.header-padding-top {
  padding-top: var(--header-height) !important;
}

/* Classes para diferentes tipos de conteúdo */
.full-height-section {
  min-height: calc(100vh - var(--header-height));
}

.content-with-header {
  padding-top: calc(var(--header-height) + 2rem);
}

.header__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--header-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* ===================== LOGO COMPONENT ===================== */
.header__logo {
  display: flex;
  align-items: center;
  gap: var(--logo-gap);
  text-decoration: none;
}

.header__logo-img {
  height: var(--logo-height);
  width: auto;
  object-fit: contain;
}

/* ===================== DESKTOP NAVIGATION ===================== */
.header__nav-desktop {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--nav-gap);
}

.header__nav-item {
  position: relative;
}

.header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--nav-link-padding);
  border-radius: var(--nav-link-border-radius);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: var(--nav-link-transition);
  white-space: nowrap;
}

.header__nav-link:hover {
  background: rgba(178, 34, 34, 0.1);
  color: var(--primary);
}

/* Area Aluno Button Styling */
.header__nav-link--area-aluno {
  background: linear-gradient(135deg, #b22222, #8b0000);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(178, 34, 34, 0.2);
}

.header__nav-link--area-aluno:hover {
  background: linear-gradient(135deg, #8b0000, #660000);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(178, 34, 34, 0.3);
  color: var(--white);
}

/* ===================== MOBILE MENU BUTTON ===================== */
.header__mobile-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.header__mobile-btn:hover {
  background: rgba(178, 34, 34, 0.1);
  transform: scale(1.05);
}

.header__mobile-btn:active {
  transform: scale(0.95);
}

/* Hamburger Icon Animation */
.header__mobile-btn-icon {
  position: relative;
  width: 24px;
  height: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.header__mobile-btn-icon::before,
.header__mobile-btn-icon::after,
.header__mobile-btn-icon {
  position: relative;
}

.header__mobile-btn-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.header__mobile-btn-icon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.header__mobile-btn-middle {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}

/* Animated state when menu is open */
.header__mobile-btn.active .header__mobile-btn-icon::before {
  transform: rotate(45deg) translate(6px, 6px);
}

.header__mobile-btn.active .header__mobile-btn-icon::after {
  transform: rotate(-45deg) translate(6px, -6px);
}

.header__mobile-btn.active .header__mobile-btn-middle {
  opacity: 0;
  transform: translateY(-50%) scale(0);
}

/* ===================== MOBILE NAVIGATION ===================== */
.header__nav-mobile {
  position: fixed;
  top: 0;
  right: -100%;
  width: var(--mobile-menu-width);
  height: 100vh;
  background: var(--mobile-menu-bg);
  box-shadow: var(--mobile-menu-shadow);
  padding: 2rem 0;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: var(--header-z-index);
  overflow-y: auto;
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
}

.header__nav-mobile.active {
  right: 0;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.header__nav-mobile-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-top: 5rem;
}

.header__nav-mobile-item {
  margin: 0;
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.3s ease;
}

.header__nav-mobile.active .header__nav-mobile-item {
  opacity: 1;
  transform: translateX(0);
}

.header__nav-mobile.active .header__nav-mobile-item:nth-child(1) { transition-delay: 0.1s; }
.header__nav-mobile.active .header__nav-mobile-item:nth-child(2) { transition-delay: 0.15s; }
.header__nav-mobile.active .header__nav-mobile-item:nth-child(3) { transition-delay: 0.2s; }
.header__nav-mobile.active .header__nav-mobile-item:nth-child(4) { transition-delay: 0.25s; }
.header__nav-mobile.active .header__nav-mobile-item:nth-child(5) { transition-delay: 0.3s; }
.header__nav-mobile.active .header__nav-mobile-item:nth-child(6) { transition-delay: 0.35s; }

.header__nav-mobile-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.header__nav-mobile-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.header__nav-mobile-link:hover::before {
  transform: scaleY(1);
}

.header__nav-mobile-link:hover {
  background: rgba(178, 34, 34, 0.08);
  color: var(--primary);
  padding-left: 2.5rem;
}

/* Remove active page highlighting in mobile menu */
.header__nav-mobile-link.active,
.header__nav-mobile-link[aria-current="page"],
.header__nav-mobile-link.current {
  background: none !important;
  color: var(--text) !important;
  font-weight: 500;
}

/* Remove active page highlighting in desktop menu */
.header__nav-link.active,
.header__nav-link[aria-current="page"],
.header__nav-link.current {
  background: none !important;
  color: var(--text) !important;
}

/* Keep special styling only for area-aluno button */
.header__nav-link--area-aluno.active,
.header__nav-link--area-aluno[aria-current="page"],
.header__nav-mobile-link--area-aluno.active,
.header__nav-mobile-link--area-aluno[aria-current="page"] {
  background: linear-gradient(135deg, #b22222, #8b0000) !important;
  color: var(--white) !important;
}

.header__nav-mobile-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.header__nav-mobile-link--area-aluno {
  background: linear-gradient(135deg, #b22222, #8b0000);
  color: var(--white);
  font-weight: 600;
  margin: 1rem;
  border-radius: var(--nav-link-border-radius);
  border-bottom: none;
}

.header__nav-mobile-link--area-aluno:hover {
  background: linear-gradient(135deg, #8b0000, #660000);
  color: var(--white);
}

/* Mobile Close Button */
.header__mobile-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.header__mobile-close:hover {
  background: rgba(178, 34, 34, 0.1);
  color: var(--primary);
  transform: scale(1.1) rotate(90deg);
}

.header__mobile-close:active {
  transform: scale(0.95) rotate(90deg);
}

/* ===================== MOBILE OVERLAY ===================== */
.header__overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--mobile-overlay-bg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: calc(var(--header-z-index) - 1);
  backdrop-filter: blur(2px);
}

.header__overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===================== RESPONSIVE BREAKPOINTS ===================== */
@media (max-width: 768px) {
  .header__nav-desktop {
    display: none;
  }
  
  .header__mobile-btn {
    display: flex;
  }
  
  .header__container {
    padding: 0.75rem 1rem;
  }
  
  :root {
    --header-height: 75px;
    --logo-height: 50px;
    --nav-gap: 1rem;
  }
  
  body {
    padding-top: 75px !important;
  }
  
  .hero {
    padding-top: calc(75px * 0.3);
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 65px;
    --mobile-menu-width: 100vw;
    --logo-height: 42px;
  }
  
  .header__container {
    padding: 0.5rem 1rem;
  }
  
  body {
    padding-top: 65px !important;
  }
  
  .hero {
    padding-top: calc(65px * 0.3);
  }
  
  .header__mobile-close {
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
  }
  
  .header__nav-mobile-list {
    padding-top: 4rem;
  }
}

/* ===================== ACCESSIBILITY ===================== */
@media (prefers-reduced-motion: reduce) {
  .header,
  .header__nav-link,
  .header__mobile-btn,
  .header__nav-mobile,
  .header__overlay {
    transition: none;
  }
}

/* Focus states for keyboard navigation */
.header__nav-link:focus,
.header__mobile-btn:focus,
.header__nav-mobile-link:focus,
.header__mobile-close:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
} 