/* ==========================================================================
   NAVBAR MODERN & RESPONSIVE DRAWER - RS ISLAM WONOSOBO
   Extracted from app/Views/frontend/partials/navbar-tailwind.php (Stage 3.4D.1)
   ========================================================================== */

/* Sticky Header Frosted Glass (Backdrop Blur) on Scroll */
  .main-header {
    transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .topbar-header {
    background-color: #174C3C;
    border-bottom: 2px solid #D4AF37 !important;
    font-size: 0.8rem;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
  }

  .main-navbar-bar {
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease;
  }

  .main-header.is-scrolled {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  }

  .main-header.is-scrolled .topbar-header {
    background-color: rgba(23, 76, 60, 0.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .main-header.is-scrolled .main-navbar-bar {
    background-color: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  }

  .main-header.is-scrolled .ticker-fade-left {
    background: linear-gradient(to right, rgba(23, 76, 60, 0.92), transparent);
  }

  .main-header.is-scrolled .ticker-fade-right {
    background: linear-gradient(to left, rgba(23, 76, 60, 0.92), transparent);
  }

  /* Brand Logo & Sizing */
  .brand-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
  }
  .brand-logo-wrap:hover .brand-logo-img {
    transform: scale(1.05);
  }
  .brand-text-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .brand-title-text {
    font-size: 1.15rem;
    line-height: 1.15;
  }
  .brand-motto-rotator {
    height: 20px;
    overflow: hidden;
    display: block;
    position: relative;
  }
  .brand-motto-track {
    display: flex;
    flex-direction: column;
    animation: mottoRotate 6s cubic-bezier(0.77, 0, 0.175, 1) infinite;
  }
  .brand-motto-item {
    height: 20px;
    line-height: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    font-style: italic;
    color: #997A2B;
    white-space: nowrap;
    display: flex;
    align-items: center;
    margin: 0;
  }
  .brand-motto-item.brand-motto-arabic {
    font-family: 'Amiri', serif;
  }

  @keyframes mottoRotate {
    0%, 42% {
      transform: translateY(0%);
    }
    48%, 92% {
      transform: translateY(-33.333%);
    }
    98%, 100% {
      transform: translateY(-66.666%);
    }
  }

  @media (max-width: 575.98px) {
    .brand-logo-img {
      height: 48px;
      width: 48px;
    }
    .brand-title-text {
      font-size: 0.98rem;
      line-height: 1.2;
    }
    .brand-motto-rotator {
      height: 18px;
      margin-top: 1px !important;
    }
    .brand-motto-item {
      height: 18px;
      line-height: 18px;
      font-size: 0.68rem;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .brand-motto-track {
      animation: none;
    }
  }

  /* Mobile Hamburger Button Optical & Flex Alignment */
  .mobile-burger-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #174C3C;
    line-height: 1;
    transition: background-color 0.2s ease, transform 0.15s ease;
  }
  .mobile-burger-btn:active {
    background-color: rgba(23, 76, 60, 0.08);
    transform: scale(0.95);
  }
  .mobile-burger-btn i {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Nav Main Links */
  .nav-main-link {
    position: relative;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
  }
  .nav-main-link:hover, .nav-main-link.active {
    color: #174C3C !important;
    background-color: #F0FDF4;
  }

  /* Dropdown styling */
  .nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8.5px 14px;
    font-size: 0.86rem;
    color: #374151;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .nav-dropdown-item:hover {
    background-color: #F0FDF4;
    color: #174C3C !important;
  }

  /* CTA buttons */
  .btn-nav-antrean {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff !important;
    background-color: #174C3C;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .btn-nav-antrean:hover {
    background-color: #14532D;
    color: #ffffff !important;
  }

  .btn-nav-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151 !important;
    background-color: #ffffff;
    border: 1px solid #D1D5DB;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
  }
  .btn-nav-outline:hover {
    border-color: #174C3C;
    color: #174C3C !important;
    background-color: #F0FDF4;
  }

  .btn-nav-lang {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background-color: #ffffff;
    border: 1px solid #D1D5DB;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .btn-nav-lang:hover {
    border-color: #174C3C;
    background-color: #F0FDF4;
  }

  /* Drawer items */
  .drawer-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .drawer-nav-item:hover {
    background-color: #F0FDF4;
    color: #174C3C !important;
  }
  .drawer-subnav-item {
    display: block;
    padding: 6px 12px;
    font-size: 0.84rem;
    color: #4B5563;
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.15s ease;
  }
  .drawer-subnav-item:hover {
    color: #174C3C !important;
  }

  /* Topbar Marquee Continuous Ticker */
  .topbar-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: topbarMarquee 26s linear infinite;
  }
  .ticker-item {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    font-size: 0.78rem;
  }
  .ticker-bullet {
    margin: 0 10px;
    color: #D4AF37;
    font-size: 0.9rem;
  }
  .ticker-fade-left, .ticker-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 2;
    pointer-events: none;
  }
  .ticker-fade-left {
    left: 0;
    background: linear-gradient(to right, #174C3C, transparent);
  }
  .ticker-fade-right {
    right: 0;
    background: linear-gradient(to left, #174C3C, transparent);
  }
  @keyframes topbarMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
  }

  /* Language Dropdown Animation */
  #navbar-lang-menu, #mobile-lang-menu {
    animation: rsiLangFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes rsiLangFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .lang-drawer-btn {
    transition: all 0.15s ease-in-out;
  }
  .lang-drawer-btn.is-active {
    background-color: #174C3C !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  }
  .lang-drawer-btn:not(.is-active) {
    background-color: #ffffff !important;
    color: #374151 !important;
    font-weight: 500;
  }
  .lang-drawer-btn:not(.is-active):hover {
    background-color: #f3f4f6 !important;
  }

  /* Mobile Drawer Smooth Slide Animation */
  .mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 320px;
    max-width: 85vw;
    background-color: #ffffff;
    z-index: 1060;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s ease;
  }
  .mobile-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  /* RTL mirror adjustments for Arabic */
  [dir="rtl"] .mobile-drawer {
    right: auto;
    left: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
  }
  [dir="rtl"] .mobile-drawer.is-open {
    transform: translateX(0);
  }
  [dir="rtl"] .fa-chevron-right {
    transform: rotate(180deg);
  }
  .is-rotated {
    transform: rotate(180deg) !important;
  }

  /* Mobile Drawer Overlay Backdrop with Blur & Fade */
  .mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1055;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .mobile-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Submenu Accordion Slide */
  .drawer-submenu-collapse {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s ease,
                padding 0.28s ease;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  .drawer-submenu-collapse.is-expanded {
    max-height: 520px;
    opacity: 1;
    padding-top: 0.25rem !important;
    padding-bottom: 0.5rem !important;
  }
