/**
 * Modern BizTheme Header Styles
 */

/* Import Inter font at the top */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Default values - will be overridden by customizer */
    --primary-color: var(--school-primary, #FF4500);
    --secondary-color: var(--school-secondary, #FFA500);
    --accent-color: var(--school-accent, #FFD700);
    --text-primary: var(--school-text, #555555);
    --text-secondary: #666666;
    --header-height: 90px;
    --dropdown-bg: var(--header-bg-color, #ffffff);
    --dropdown-shadow: rgba(0, 0, 0, 0.15);
    font-family: 'Inter', sans-serif;
}

/* Ensure all elements use Inter font */
* {
    font-family: 'Inter', sans-serif;
}

/* Glass morphism effect */
.glass-effect {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--header-bg-color, rgba(255, 255, 255, 0.95));
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Modern Header Styles - Use customizer colors */
.modern-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000;
    height: var(--header-height, 90px);
    background: var(--header-bg-color, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: none;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    box-shadow: none;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Admin bar support - push header down when admin bar is present */
.admin-bar .modern-header {
    top: 32px;
}

/* Mobile admin bar is smaller */
@media screen and (max-width: 782px) {
    .admin-bar .modern-header {
        top: 46px;
    }
}

/* Faster and more immediate scroll effect */
.modern-header.scrolled {
    background: var(--header-bg-color, rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: none;
    border-bottom: none;
}

/* Enhanced logo visibility with customizer colors */
.modern-header .logo-container .custom-logo {
    max-height: 70px !important;
    max-width: 250px !important;
    height: auto !important;
    width: auto !important;
    object-fit: contain !important;
    object-position: left center !important;
    transition: all 0.4s ease !important;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.modern-header.scrolled .logo-container .custom-logo {
    filter: none;
}

/* Site title with customizer colors */
.modern-header .site-title-text {
    font-size: 1.75rem !important;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: white;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.8));
    transition: all 0.4s ease;
}

.modern-header.scrolled .site-title-text {
    filter: none;
}

/* Navigation container */
.nav-container {
    position: relative;
}

/* Navigation Styles */
.nav-container .main-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

/* Main navigation list */
.main-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Navigation items */
.nav-item {
    background-color: transparent;
    position: relative;
}

/* Navigation links with customizer colors */
.nav-link {
    position: relative;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--header-bg-color);
    backdrop-filter: none;
    border: none;
    text-shadow: none;
}

.modern-header.scrolled .nav-link {
    background: var(--header-bg-color);
    backdrop-filter: none;
    border: none;
    text-shadow: none;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    background: rgba(255, 69, 0, 0.05);
    backdrop-filter: none;
    box-shadow: none;
}

.modern-header.scrolled .nav-link:hover {
    background: rgba(255, 69, 0, 0.05);
    backdrop-filter: none;
    box-shadow: none;
}

/* Dropdown indicator */
.nav-link.has-dropdown::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-link.has-dropdown::after {
    transform: rotate(180deg);
}

/* Hover underline effect */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 80%;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    background: rgba(255, 69, 0, 0.05);
}

/* Dropdown menu - Single vertical container for all levels */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    max-width: 380px;
    background: var(--dropdown-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: all 0.3s ease;
    padding: 0.75rem;
    z-index: 1001;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    max-height: 70vh;
    overflow-y: auto;
}

/* Remove second level dropdown positioning - everything stays in main dropdown */
.dropdown-menu .dropdown-menu {
    display: none;
}

/* Show dropdown on hover */
.nav-item:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Keep dropdown visible when hovering over it */
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Level 1 dropdown items */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s ease;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    position: relative;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.8);

}

/* Level 2 items - sub items with children indicator */
.dropdown-item.has-sub {
    position: relative;
}

.dropdown-item.has-sub::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--primary-color);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.dropdown-item.has-sub:hover::after {
    opacity: 1;
    transform: translateY(-50%) rotate(180deg);
}

/* Level 3 items - sub-sub items, initially hidden */
.dropdown-item.level-3 {
    padding-left: 2.5rem;
    padding-right: 1rem;
    background: rgba(255, 165, 0, 0.08);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0;
    margin-right: 0;
    border-left: 3px solid var(--secondary-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    width: 100%;
}

/* Show level 3 items when parent is hovered */
.group\/sub:hover .dropdown-item.level-3 {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    max-height: 60px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Ensure proper spacing between all items */
.dropdown-item:not(.level-3) + .dropdown-item.level-3 {
    margin-top: 0.25rem;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.1), rgba(255, 165, 0, 0.05));
    color: var(--primary-color);
    transform: translateX(2px);
}

.dropdown-item.level-3:hover {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.15), rgba(255, 165, 0, 0.1));
    transform: translateX(4px);
}

/* Enhanced group hover states for better containment */
.group\/sub {
    position: relative;
    width: 100%;
}

/* Keep parent highlighted when hovering sub-items */
.group\/sub:hover > a {
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.1), rgba(255, 165, 0, 0.05));
    color: var(--primary-color);
}

/* Ensure sub-items stay within container */
.group\/sub .dropdown-item.level-3 {
    position: relative;
    left: 0;
    right: 0;
    width: calc(100% - 0.5rem);
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

/* CTA Button with customizer colors */
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: none;
    backdrop-filter: none;
    border: none;
}

.modern-header.scrolled .cta-button {
    backdrop-filter: none;
    border: none;
    box-shadow: none;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: none;
    color: white;
}

.webuntis-logo {
    width: 20px !important;
}

/* Hamburger - remove transparent background */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001;
    align-items: center;
    outline: none;
}

.hamburger:focus {
    outline: 2px solid var(--orange-primary);
    outline-offset: 2px;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center;
    margin: 2px 0;
    position: relative;
}

.hamburger span:first-child {
    margin-top: 0;
}

.hamburger span:last-child {
    margin-bottom: 0;
}

.hamburger:hover span {
    background: var(--orange-primary);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background: var(--orange-primary);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: var(--orange-primary);
}

/* Mobile menu with glass effect */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    transform: translateY(-100%);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
}

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Responsive Design - Progressive Enhancement */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .header-content {
        gap: 1.25rem;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .nav-container {
        margin-right: 1rem;
    }
    
    /* Slightly smaller logo on tablets */
    header.modern-header .logo-container .custom-logo {
        max-height: 60px !important;
        max-width: 220px !important;
    }
}

/* Tablets - Switch to mobile navigation at 1024px */
@media (max-width: 1024px) {
    .modern-header {
        height: 75px !important;
        padding: 0 !important;
        margin: 0 !important;
        top: 0 !important;
        position: fixed !important;
    }
    
    .header-content {
        height: 75px !important;
        padding: 0 1rem !important;
        margin: 0 !important;
        box-sizing: border-box;
    }
    
    .nav-container {
        display: none !important;
    }
    
    /* Hide CTA button when switching to mobile nav */
    .cta-button {
        display: none !important;
    }
    
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        height: 100%;
    }
    
    .header-content {
        grid-template-columns: 1fr auto;
        gap: 1rem;
    }
    
    .logo-container {
        justify-self: start;
        display: flex;
        align-items: center;
        height: 100%;
    }
    
    /* Hide desktop CTA on tablets */
    .hidden.lg\\:flex {
        display: none !important;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    body {
        padding-top: 70px !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Remove spacing from all content elements on mobile */
    .entry-content, 
    .page-content,
    .post-content,
    .site-content,
    .content-area,
    #primary,
    #main,
    .site-main {
        margin: 0 !important;
        padding-top: 0 !important;
        /* Preserve WordPress block formatting */
        font-family: inherit;
        line-height: inherit;
    }

    /* Ensure WordPress blocks maintain their formatting */
    .entry-content .wp-block,
    .page-content .wp-block,
    .post-content .wp-block {
        margin-left: auto;
        margin-right: auto;
        max-width: none;
    }

    /* Mobile logo sizing */
    header.modern-header .logo-container .custom-logo {
        max-height: 45px !important;
        max-width: 180px !important;
    }
    
    header.modern-header .site-logo-icon {
        width: 35px;
        height: 35px;
    }
    
    header.modern-header .site-title-text {
        font-size: 1.2rem;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    :root {
        --header-height: 65px;
    }
    
    body {
        padding-top: 65px !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Extra small logo */
    header.modern-header .logo-container .custom-logo {
        max-height: 40px !important;
        max-width: 160px !important;
    }
    
    header.modern-header .site-logo-icon {
        width: 32px;
        height: 32px;
    }
    
    header.modern-header .site-title-text {
        font-size: 1rem;
    }
    
    .hamburger {
        width: 26px;
        height: 18px;
    }
    
    .hamburger span {
        height: 2.5px;
    }
}

/* Content spacing - Remove ALL padding and margins */
.content-wrapper {
    padding: 0 !important;
    margin: 0 !important;
    transition: none;
    position: relative;
    z-index: 1;
}

/* Remove WordPress default spacing from all content elements */
.entry-content, 
.page-content,
.post-content,
.site-content,
.content-area,
#primary,
#main,
.site-main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure body is the only element with top padding */
body {
    padding-top: var(--header-height) !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
}

/* Mobile phones */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    body {
        padding-top: 70px !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Remove spacing from all content elements on mobile */
    .entry-content, 
    .page-content,
    .post-content,
    .site-content,
    .content-area,
    #primary,
    #main,
    .site-main {
        margin: 0 !important;
        padding-top: 0 !important;
        /* Preserve WordPress block formatting */
        font-family: inherit;
        line-height: inherit;
    }

    /* Ensure WordPress blocks maintain their formatting */
    .entry-content .wp-block,
    .page-content .wp-block,
    .post-content .wp-block {
        margin-left: auto;
        margin-right: auto;
        max-width: none;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    :root {
        --header-height: 65px;
    }
    
    body {
        padding-top: 65px !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    body {
        padding-top: 75px !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
    }
}


.mobile-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.4);
    color: white;
}

/* Responsive mobile adjustments */
@media (max-width: 768px) {
    .mobile-menu {
        top: 90px;
        height: calc(100vh - 80px);
    }
    
    .mobile-menu-content {
        padding: 1.25rem 1rem 1.5rem;
    }
    
    .mobile-cta-section {
        padding: 1.5rem 0.75rem 0 0.75rem;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        top: 75px;
        height: calc(100vh - 75px);
    }
    
    .mobile-menu-content {
        padding: 1rem 0.875rem 1.25rem;
    }
    
    .mobile-cta-section {
        padding: 1.25rem 0.5rem 0 0.5rem;
    }
    
    .mobile-cta-button {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
}
    .mobile-nav-item a {
        font-size: 1.0625rem;
        padding: 0.8125rem 0;
        gap: 0.8125rem;
    }
    
    .mobile-dropdown {
        padding-left: 1rem;
        border-left-width: 3px;
    }
    
    .mobile-dropdown.active {
        padding: 0.875rem 0 0.875rem 1rem;
    }
    
    .mobile-sub-dropdown {
        padding-left: 0.875rem;
    }
    
    .mobile-sub-dropdown.active {
        padding: 0.625rem 0 0.625rem 0.875rem;
    }

@media (max-width: 480px) {
    .mobile-menu-content {
        padding: 1rem 0.875rem 1.25rem;
    }
    
    .mobile-nav-title {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .mobile-nav-item a {
        font-size: 1rem;
        padding: 0.75rem 0;
        gap: 0.75rem;
    }
    
    .mobile-nav-toggle {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .mobile-cta-button {
        font-size: 1rem;
        padding: 0.875rem 1.25rem;
    }
}

/* Clean Sub-Dropdown Menu - inline within main dropdown */
.sub-dropdown-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    min-width: auto !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0.25rem 0 0 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: auto !important;
    list-style: none !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    transform: none !important;
    transition: none !important;
    border: none !important;
    display: none;
    width: 100%;
}

/* Show sub-dropdown when hovering over parent dropdown item */
.dropdown-list-item:hover > .sub-dropdown-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Keep sub-dropdown open when hovering over it */
.sub-dropdown-menu:hover {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sub-dropdown-list-item {
    list-style: none;
    margin: 0;
    padding-top: 1px;
    padding-bottom: 1px;
    width: 100%;
}

/* Simple Sub-Dropdown Items - indented within main dropdown */
.sub-dropdown-item {
    display: block;
    padding: 0.625rem 1rem 0.625rem 2rem !important; /* Extra left padding for indentation */
    color: var(--text-secondary);
    text-decoration: none !important;
    font-size: 0.85rem !important;
    background: rgba(255, 165, 0, 0.05) !important;
    transition: all 0.25s ease;
    border: none;
    margin: 0.125rem 0.5rem !important;
    font-weight: 400 !important;
    border-radius: 6px !important;
    border-left: 3px solid var(--school-secondary) !important;
    position: relative;
}

.sub-dropdown-item::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--school-secondary);
    font-size: 0.75rem;
    opacity: 0.6;
}

.sub-dropdown-item:hover {
    background: rgba(255, 69, 0, 0.1) !important;
    color: var(--school-primary) !important;
    text-decoration: none !important;
    transform: translateX(2px);
    border-left-color: var(--school-primary) !important;
}

.sub-dropdown-item:hover::before {
    color: var(--school-primary);
    opacity: 1;
}

/* Enhanced hover effects for proper nesting */
.dropdown-list-item {
    position: relative;
}

/* Visual indicator for items with sub-menus - improved styling */
.dropdown-item.has-children::after {
    content: ' ▼';
    float: right;
    color: var(--school-primary);
    font-weight: bold;
    opacity: 0.7;
    transition: all 0.3s ease;
    font-size: 0.7rem;
}

.dropdown-item.has-children:hover::after {
    opacity: 1;
    transform: rotate(180deg);
}

/* Ensure main dropdown stays open when hovering sub-items */
.nav-item:hover .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
}

/* Keep parent item highlighted when hovering sub-items */
.dropdown-list-item:hover .dropdown-item.has-children {
    background: rgba(255, 69, 0, 0.1);
    color: var(--school-primary);
}

/* Smooth transitions for main dropdown only */
.dropdown-menu {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Ensure proper spacing for parent items with children */
.dropdown-list-item:has(.sub-dropdown-menu) {
    margin-bottom: 0;
}

/* Make sure the entire dropdown container accommodates sub-items */
.dropdown-menu {
    min-width: 280px; /* Slightly wider to accommodate indented items */
    max-width: 400px;
}