/* ==========================================================================
   HEADER COMPONENT STYLES (v4.5 — STREAMLINED & OPTIMIZED)
   Miracle IT Career Academy
   ========================================================================== */

/* --------------------------------------------------------------------------
   HEADER MOUNT WRAPPER
   -------------------------------------------------------------------------- */

[data-component="header"] {
  display: block;
  width: 100%;
  height: var(--header-height, 74px);
  position: relative;
  z-index: 1000;
}

/* --------------------------------------------------------------------------
   MAIN STICKY HEADER
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  z-index: 1000;

  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);

  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

  transition:
    background-color 250ms ease,
    border-color 250ms ease,
    box-shadow 250ms ease;
}

/* Scrolled elevation state */
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  border-bottom-color: rgba(255, 122, 0, 0.25);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.07),
    0 1px 0 rgba(0, 0, 0, 0.04);
}

/* --------------------------------------------------------------------------
   HEADER CONTAINER
   -------------------------------------------------------------------------- */

.header-container {
  width: 100%;
  max-width: var(--container-max-width, 1320px);
  margin-inline: auto;
  padding-inline: var(--container-padding, 1.5rem);
  height: var(--header-height, 74px);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* --------------------------------------------------------------------------
   BRAND IDENTITY
   -------------------------------------------------------------------------- */

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;

  flex: 0 0 auto;
  min-width: 0;

  color: inherit;
  text-decoration: none;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.brand-logo:hover {
  transform: translateY(-1px) scale(1.02);
  opacity: 1;
}

.logo-mark {
  width: 42px;
  height: 36px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 10px rgba(255, 96, 0, 0.28));
  transition: transform 180ms ease, filter 180ms ease;
}

.brand-logo:hover .logo-mark {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 14px rgba(255, 96, 0, 0.48));
}

.logo-mark svg,
.brand-emblem-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  color: #FF6000;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-name .gradient-text,
.brand-name .brand-it {
  color: #2563EB;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  margin-top: 2px;
  color: #38bdf8;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   DESKTOP NAVIGATION
   -------------------------------------------------------------------------- */

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.2rem;

  margin: 0;
  padding: 0.25rem 0.35rem;
  list-style: none;

  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 9999px;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-list li {
  display: flex;
  flex: 0 0 auto;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 36px;
  padding: 0.4rem 0.8rem;

  color: #334155;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 9999px;

  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    transform 150ms ease;
}

.nav-link:hover {
  color: #0F172A;
  background: rgba(15, 23, 42, 0.06);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}

.nav-link.is-active {
  color: #FF6000;
  background: rgba(255, 122, 0, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 122, 0, 0.35),
    0 0 14px rgba(255, 122, 0, 0.18);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   HEADER RIGHT ACTIONS
   -------------------------------------------------------------------------- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}

/* Call / WhatsApp Dual Action Pill */
.header-call-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem 0.55rem;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 9999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.header-call-whatsapp:hover {
  background: rgba(15, 23, 42, 0.08);
  border-color: rgba(255, 122, 0, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.header-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  color: #1E293B;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 9999px;
  transition: color 150ms ease, background-color 150ms ease;
  white-space: nowrap;
}

.header-contact-pill:hover {
  background: rgba(15, 23, 42, 0.06);
}

.header-contact-pill.call-pill:hover {
  color: #0284C7;
}

.header-contact-pill.whatsapp-pill:hover {
  color: #16A34A;
}

.header-contact-pill .contact-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.header-contact-pill.call-pill .contact-icon {
  color: #0284C7;
}

.header-contact-pill.whatsapp-pill .contact-icon {
  color: #25D366;
  transition: color 150ms ease, transform 150ms ease;
}

.header-contact-pill.whatsapp-pill:hover .contact-icon {
  color: #16A34A;
  transform: scale(1.08);
}

.contact-sep {
  color: rgba(15, 23, 42, 0.25);
  font-weight: 600;
  font-size: 0.8rem;
  user-select: none;
}

/* Helpline button (Legacy / Fallback) */
.header-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;

  padding: 0.4rem 0.85rem;
  color: #f8fafc;
  text-decoration: none;
  white-space: nowrap;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;

  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.header-phone-link:hover {
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 122, 0, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.phone-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  color: #38bdf8;
}

.phone-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.phone-label {
  color: rgba(148, 163, 184, 0.75);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.phone-number {
  margin-top: 2px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

/* Primary Book CTA */
.header-book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;

  min-height: 40px;
  padding: 0.52rem 1.15rem;

  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border-radius: 9999px;

  background: linear-gradient(135deg, #FF851A 0%, #EA580C 100%);
  background-size: 200% auto;
  box-shadow: 0 4px 18px rgba(79, 70, 229, 0.32);

  text-decoration: none;

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease,
    background-position 300ms ease;
}

.header-book-btn:hover {
  color: #ffffff;
  transform: translateY(-2px);
  background-position: right center;
  box-shadow: 0 6px 22px rgba(79, 70, 229, 0.45);
  filter: brightness(1.05);
}

/* --------------------------------------------------------------------------
   MOBILE TOGGLE BUTTON & ANIMATED HAMBURGER
   -------------------------------------------------------------------------- */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;

  width: 42px;
  height: 42px;
  flex: 0 0 42px;

  padding: 9px;
  cursor: pointer;

  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;

  transition:
    background-color 180ms ease,
    border-color 180ms ease;
}

.nav-toggle:hover {
  background: rgba(15, 23, 42, 0.09);
  border-color: rgba(255, 122, 0, 0.4);
}

.hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #0F172A;
  border-radius: 2px;
  transition:
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease;
  transform-origin: center;
}

/* Animate 3 bars into an 'X' when open */
.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile actions drawer container */
.mobile-nav-actions {
  display: none;
}

/* ==========================================================================
   RESPONSIVE: COMPACT LAPTOPS & DESKTOPS (1025px - 1240px)
   ========================================================================== */

@media (max-width: 1240px) {
  .header-container {
    gap: 1rem;
    padding-inline: 1rem;
  }

  .nav-list {
    gap: 0.12rem;
    padding: 0.2rem 0.25rem;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.38rem 0.65rem;
  }

  .header-actions {
    gap: 0.55rem;
  }

  .phone-text .phone-label {
    display: none;
  }

  .phone-text .phone-number {
    font-size: 0.75rem;
  }

  .header-book-btn {
    padding: 0.48rem 0.95rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 1080px) {
  .header-phone-link {
    display: none;
  }
}

/* ==========================================================================
   RESPONSIVE: TABLETS & MOBILE DRAWER (<= 1024px)
   ========================================================================== */

@media (max-width: 1024px) {
  .brand-name {
    font-size: 1.12rem;
  }

  .brand-sub {
    font-size: 0.58rem;
  }

  .logo-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  /* Hamburger toggle display */
  .nav-toggle {
    display: flex;
  }

  /* Hide desktop action buttons */
  .header-actions .header-call-whatsapp,
  .header-actions .header-phone-link,
  .header-actions .header-book-btn {
    display: none;
  }

  /* Slide-down mobile drawer */
  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height, 74px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - var(--header-height, 74px));
    max-height: calc(100dvh - var(--header-height, 74px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    margin: 0;
    padding: 1.25rem 1.5rem 1.75rem;

    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);

    border-bottom: 1px solid rgba(255, 122, 0, 0.25);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.12);

    flex-direction: column;
    align-items: stretch;

    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;

    transition:
      opacity 220ms ease,
      transform 220ms ease;
  }

  .header-nav.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-list {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;

    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

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

  .nav-link {
    display: flex;
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;

    color: #1E293B;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.06);
  }

  .nav-link:hover,
  .nav-link.is-active {
    transform: none;
    background: rgba(255, 122, 0, 0.1);
    border-color: rgba(255, 122, 0, 0.35);
    color: #FF6000;
  }

  .mobile-nav-actions {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;

    margin-top: 1.15rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .mobile-nav-actions .btn-secondary {
    background: #FFFFFF;
    color: #1E293B;
    border: 1px solid #CBD5E1;
  }

  .mobile-nav-actions .btn {
    width: 100%;
    min-height: 46px;
  }

  .mobile-nav-actions [data-config-whatsapp] .btn-icon {
    color: #25D366;
  }
}

/* ==========================================================================
   RESPONSIVE: MOBILE (<= 640px)
   ========================================================================== */

@media (max-width: 640px) {
  [data-component="header"] {
    height: 68px;
  }

  .header-container {
    height: 68px;
    padding-inline: 1rem;
    gap: 0.5rem;
  }

  .brand-logo {
    gap: 0.6rem;
  }

  .logo-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-sub {
    font-size: 0.54rem;
    letter-spacing: 0.05em;
  }

  .header-nav {
    top: 68px;
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
    padding: 1rem 1.25rem 1.5rem;
  }
}

/* ==========================================================================
   RESPONSIVE: SMALL & ULTRA-NARROW PHONES (<= 380px & 320px)
   ========================================================================== */

@media (max-width: 380px) {
  .header-container {
    padding-inline: 0.65rem;
    gap: 0.35rem;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-logo {
    gap: 0.45rem;
  }

  .brand-name {
    font-size: 0.92rem;
  }

  .brand-sub {
    display: none;
  }

  .nav-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    padding: 8px;
  }

  .header-nav {
    padding: 1rem 0.85rem 1.25rem;
  }
}

@media (max-width: 340px) {
  .header-container {
    padding-inline: 0.5rem;
  }

  .logo-mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .brand-name {
    font-size: 0.86rem;
  }

  .nav-toggle {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    padding: 7px;
  }
}

/* ==========================================================================
   ACCESSIBILITY: REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .brand-logo,
  .nav-link,
  .header-phone-link,
  .header-book-btn,
  .nav-toggle,
  .hamburger-bar,
  .header-nav {
    transition: none !important;
  }
}
/* Exact Rectangular Company Logo in Header */
.header-brand-logo-img {
  display: block;
  height: 48px;
  width: auto;
  max-width: 230px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
  transition: transform 180ms ease, filter 180ms ease;
}

.brand-logo:hover .header-brand-logo-img {
  transform: scale(1.02);
  filter: drop-shadow(0 4px 16px rgba(255, 122, 0, 0.35));
}

@media (max-width: 768px) {
  .brand-logo {
    padding: 0;
  }
  .header-brand-logo-img {
    height: 38px;
    max-width: 185px;
  }
}

@media (max-width: 360px) {
  .brand-logo {
    padding: 0;
  }
  .header-brand-logo-img {
    height: 32px;
    max-width: 155px;
  }
}
