/* === Poetic Pilot Header CSS === */
.ast-mobile-menu-buttons,
.ast-button-wrap,
.ast-header-break-point .ast-builder-menu-toggle,
.ast-builder-layout-element.site-header-focus-item {
  display: none !important;
}
.site-header,
.main-header-bar,
.ast-site-header-wrap {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}


.poetic-main-header {
    background: #ffd700 !important;
    border-bottom: 2px solid #d9d9d9;
    position: sticky;
    top: 0;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
}


.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* Logo */
.header-logo img {
    height: 40px;
    width: auto;
}

/* Desktop navigation */
.desktop-menu ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
.desktop-menu ul li {
    margin: 0 15px;
}
.desktop-menu ul li a {
    position: relative;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #000;
    text-decoration: none;
    transition: color 0.3s ease;
}
.desktop-menu ul li a:hover {
    color: #0073e6;
}
.desktop-menu ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    left: 0;
    bottom: -4px;
    background-color: #0073e6;
    transition: width 0.3s ease;
}
.desktop-menu ul li a:hover::after {
    width: 100%;
}

/* Student login button */
.desktop-login .login-btn {
    background-color: #0073e6 !important;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 16px !important;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease;
}
.desktop-login .login-btn:hover {
    background-color: #005bb5 !important;
}

/* Mobile menu */
.mobile-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border-top: 1px solid #d9d9d9;
    position: absolute;
    top: 100%; /* below mobile-actions */
    left: 0;
    z-index: 999;
    padding: 10px 0;
}
.mobile-menu.active {
    display: flex;
}
.mobile-menu ul {
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
}
.mobile-menu ul li {
    margin: 10px 0;
    text-align: center;
}
.mobile-menu ul li a {
    text-decoration: none;
    color: #000;
    font-weight: 600;
    padding: 10px 0;
}

/* Hamburger animation */
.mobile-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Floating contact button */
.floating-contact {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #0073e6;
    color: #fff;
    font-size: 22px;
    text-decoration: none;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    animation: bounceIn 0.6s ease, pulse 2s infinite ease-in-out 0.6s;
}
.floating-contact:hover { background-color: #005bb5; transform: scale(1.1); }

/* Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
    z-index: 9998;
}

/* Animations */
@keyframes bounceIn { 0% { transform: scale(0.8); opacity:0; } 60% { transform: scale(1.1); opacity:1; } 100% { transform: scale(1); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* Tooltip for contact button */
.floating-contact::after {
    content: "Contact Us";
    position: absolute;
    right: 70px;
    background: #0073e6;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(10px);
    white-space: nowrap;
    pointer-events: none;
}
.floating-contact:hover::after { opacity:1; transform: translateX(0); }


/* Responsive Mobile Layout */
@media (max-width: 768px) {
    /* Hide desktop menu + login */
    .desktop-menu,
    .desktop-login {
        display: none;
    }

    /* Center logo */
    .header-logo {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 10px;
    }

    /* Mobile actions row only shows hamburger */
    .mobile-actions {
        display: flex;
        justify-content: flex-end; /* hamburger to right */
        align-items: center;
        width: 100%;
        padding: 0 15px;
        margin-bottom: 10px;
    }

    /* Show hamburger */
    .mobile-toggle { display: block; cursor: pointer; }
    .mobile-toggle span { display: block; width: 25px; height: 3px; background: #000; margin: 4px 0; transition: 0.3s; }

    /* Mobile menu */
    .mobile-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        border-top: 1px solid #d9d9d9;
        position: absolute;
        top: 100%; /* below mobile-actions */
        left: 0;
        z-index: 999;
        padding: 10px 0;
    }

    /* Show mobile menu when active */
    .mobile-menu.active {
        display: flex;
    }

    /* Mobile menu items spacing */
    .mobile-menu ul li {
        margin: 10px 0;
        text-align: center;
    }

    /* Mobile login button inside menu */
    .mobile-menu .mobile-login {
        margin: 15px 0 5px; /* spacing before and after */
        border-top: 1px solid #ddd;
        padding-top: 12px;
    }

    .mobile-menu .mobile-login .login-btn {
        display: inline-block;
        width: 80%;
        max-width: 220px;
        padding: 10px 16px;
        border-radius: 20px;
        background-color: #0073e6;
        color: #fff;
        font-weight: bold;
        text-decoration: none;
        transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
        text-align: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-menu .mobile-login .login-btn:hover {
        background-color: #005bb5;
        transform: scale(1.05);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    }

    /* Mobile menu link hover */
    .mobile-menu ul li a {
        transition: background 0.3s ease, transform 0.2s ease;
        border-radius: 8px;
    }

    .mobile-menu ul li a:hover {
        background-color: #f0f0f0;
        transform: translateX(5px);
    }
}

@media (min-width: 769px) {
    /* Desktop: show original layout */
    .desktop-menu,
    .desktop-login {
        display: flex;
    }

    .mobile-actions,
    .mobile-menu,
    .mobile-toggle {
        display: none;
    }
}
/* Center mobile menu items */
.mobile-menu ul {
    display: flex;
    flex-direction: column;
    align-items: center; /* centers menu items horizontally */
    list-style: none;
    margin: 0;
    padding: 0;
}
.mobile-menu .mobile-login {
    margin: 15px 0 5px;
    display: flex;
    justify-content: center;
}

/* === Menu & Submenu CSS === */

/* Base styles */
.has-submenu {
    position: relative;
}

/* Submenu (desktop) */
.has-submenu .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Submenu item spacing and style */
.has-submenu .submenu li {
    padding: 5px 15px;   /* controls each item’s height (vertical space) */
    margin: 1px 0;       /* space between submenu items */
}

.has-submenu .submenu li a {
    display: block;
    color: #000;
    font-size: 14px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.has-submenu .submenu li a:hover {
    background: rgba(0, 115, 230, 0.08);
    color: #0073e6;
}
                  
/* Show submenu on hover (desktop) */
@media (min-width: 1024px) {
    .has-submenu:hover > .submenu {
        display: block;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Nested submenu (CPL etc.) */
    .has-submenu .submenu .has-submenu > .submenu {
        top: 0;
        left: 100%;
        margin-left: 5px;
    }

    /* Only open nested when hovered on its parent, not main */
    .has-submenu .submenu .has-submenu:hover > .submenu {
        display: block;
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }
}

/* Submenu item styling */
.submenu li {
    padding: 10px 15px;
    transition: background 0.2s ease;
}
.submenu li a {
    color: #333;
    text-decoration: none;
    display: block;
}
.submenu li:hover {
    background: #f7f7f7;
}
.submenu-arrow {
    margin-left: 8px;
    font-size: 0.9em;
    transition: transform 0.3s ease;
}

/* Rotate arrow when active (mobile) */
.submenu-arrow.rotate {
    transform: rotate(180deg);
}

/* === MOBILE MENU & NESTED SUBMENU FIX === */
@media (max-width: 1023px) {
  .mobile-menu {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    overflow-y: auto;
  }

  /* Main submenu link styling */
  .mobile-menu .has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background 0.2s ease;
  }

  .mobile-menu .has-submenu > a:hover {
    background: #f2f2f2;
  }

  /* Hidden by default */
  .mobile-menu .submenu {
    display: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    background: #f9f9f9;
    margin-left: 12px;
    border-left: 2px solid #eaeaea;
    border-radius: 6px;
    transition: all 0.3s ease-in-out;
  }

  /* Show on click */
  .mobile-menu .submenu.show {
    display: block;
    max-height: 800px;
    opacity: 1;
  }

  /* Submenu items */
  .mobile-menu .submenu li a {
    display: block;
    padding: 10px 16px;
    font-size: 0.95em;
    color: #333;
    transition: background 0.2s;
  }

  .mobile-menu .submenu li a:hover {
    background: #efefef;
  }

  /* Nested submenu indentation */
  .mobile-menu .submenu .submenu {
    margin-left: 10px;
    border-left: 2px solid #ddd;
  }

  /* Arrow styling and rotation */
  .submenu-arrow {
    margin-left: 5px;
    font-size: 0.8em;
    transition: transform 0.3s ease;
  }
  .submenu-arrow.rotate {
    transform: rotate(90deg);
  }
}

/* === FIX: Enable clicks for mobile submenus === */
@media (max-width: 1023px) {
  .mobile-menu .submenu {
    position: relative !important;
    pointer-events: auto !important;
  }
  .mobile-menu .submenu.show {
    display: block !important;
    opacity: 1 !important;
    max-height: 1000px !important;
  }
}
/* Make mobile menu scrollable */
.mobile-menu {
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Prevent the whole page from locking when menu scrolls */
body.menu-open {
  overflow: hidden;
}

/* Optional — make submenu transitions smoother */
.mobile-menu .submenu {
  transition: max-height 0.3s ease;
}

/* === Custom Desktop Header Tweaks === */
@media (min-width: 769px) {
    /* Remove Astra or theme container margins */
    .poetic-main-header,
    .header-container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Make header full width */
    .poetic-main-header {
        width: 100%;
        background: #fff;
    }

    /* Flexbox layout for better spacing control */
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 40px; /* overall inner padding for entire header */
    }

    /* Logo styling */
    .header-logo {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        margin-left: 40px; /* adjust horizontal offset */
    }

    .header-logo img {
        height: 40px; /* adjust logo size */
        width: auto;
        transition: transform 0.3s ease;
    }

    .header-logo img:hover {
        transform: scale(1.05); /* nice subtle hover effect */
    }

    /* Menu area */
    .desktop-menu {
        flex: 1 1 auto;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: -40px;
    }

    .desktop-menu ul {
        display: flex;
        gap: 5px; /* adjust spacing between menu items */
        margin: 0;
        padding: 0;
    }

    .desktop-menu ul li a {
        font-size: 15px;
        font-weight: 400;
        color: #000;
        text-decoration: none;
        position: relative;
        padding: 6px 0;
    }

    .desktop-menu ul li a:hover {
        color: #0073e6;
    }

    /* Student login button */
    .desktop-login {
        flex: 0 0 auto;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        margin-right: 40px; /* adjust space from right edge */
    }

    .desktop-login .login-btn {
        background-color: #0073e6 !important;
        color: #fff !important;
        padding: 6px 16px;
        font-size: 14px;
        border-radius: 22px !important;
        text-decoration: none;
        transition: background 0.3s ease, transform 0.2s ease;
    }

    .desktop-login .login-btn:hover {
        background-color: #005bb5 !important;
        transform: scale(1.05);
    }

    /* OPTIONAL: add a subtle shadow for header separation */
    .poetic-main-header.scrolled {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
}
