/* Professional Mobile Navigation Styles */

/* Mobile Navigation Container */
@media (max-width: 768px) {
    /* Header Adjustments */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 20px rgba(0, 102, 204, 0.1);
    }

    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        position: relative;
    }

    /* Site Branding */
    .site-branding {
        flex: 1;
        z-index: 10001;
    }

    .site-title {
        font-size: 1.5rem;
        margin: 0;
        font-weight: 700;
    }

    .site-title a {
        color: var(--primary-blue);
        background: linear-gradient(135deg, #0066cc, #4d94ff);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* Hamburger Menu Button - FORCE VISIBILITY */
    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 48px;
        height: 48px;
        padding: 0;
        background: white;
        border: 2px solid var(--primary-blue);
        border-radius: 8px;
        cursor: pointer;
        position: relative;
        z-index: 10001;
        -webkit-tap-highlight-color: transparent;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .menu-toggle span {
        display: block;
        width: 28px;
        height: 3px;
        background: var(--primary-blue);
        border-radius: 3px;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        position: relative;
    }

    .menu-toggle span:nth-child(1) {
        transform: translateY(-8px);
    }

    .menu-toggle span:nth-child(3) {
        transform: translateY(8px);
    }

    /* Hamburger Animation when Active */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translateY(0);
        top: 8px;
    }

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

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translateY(0);
        top: -8px;
    }

    /* Mobile Menu Overlay */
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 10000;
        overflow-y: auto;
        padding-top: 80px;
    }

    .main-navigation.active {
        right: 0;
    }

    /* Menu Backdrop */
    .menu-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 31, 63, 0.5);
        backdrop-filter: blur(5px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 9998;
    }

    .menu-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Menu Items */
    #primary-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #primary-menu li {
        border-bottom: 1px solid rgba(0, 102, 204, 0.1);
        animation: slideInRight 0.4s ease forwards;
        opacity: 0;
    }

    #primary-menu li:nth-child(1) { animation-delay: 0.1s; }
    #primary-menu li:nth-child(2) { animation-delay: 0.15s; }
    #primary-menu li:nth-child(3) { animation-delay: 0.2s; }
    #primary-menu li:nth-child(4) { animation-delay: 0.25s; }
    #primary-menu li:nth-child(5) { animation-delay: 0.3s; }
    #primary-menu li:nth-child(6) { animation-delay: 0.35s; }

    .main-navigation.active #primary-menu li {
        opacity: 1;
    }

    #primary-menu a {
        display: block;
        padding: 1.2rem 2rem;
        color: var(--dark-blue);
        font-size: 1.1rem;
        font-weight: 500;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
        text-decoration: none !important;
    }

    /* Home icon in mobile menu */
    .menu-home a {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .menu-home a::after {
        content: 'Home';
        font-size: 1.1rem;
    }

    .menu-home svg {
        width: 20px;
        height: 20px;
    }

    #primary-menu a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 4px;
        background: var(--primary-blue);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    #primary-menu a:hover,
    #primary-menu a:focus {
        background: rgba(0, 102, 204, 0.05);
        color: var(--primary-blue);
        padding-left: 2.5rem;
    }

    #primary-menu a:hover::before,
    #primary-menu a:focus::before {
        transform: translateX(0);
    }

    /* Current Page Indicator */
    #primary-menu .current-menu-item a,
    #primary-menu .current_page_item a {
        background: rgba(0, 102, 204, 0.1);
        color: var(--primary-blue);
        font-weight: 600;
    }

    #primary-menu .current-menu-item a::before,
    #primary-menu .current_page_item a::before {
        transform: translateX(0);
    }

    /* Submenu Styles */
    #primary-menu .sub-menu {
        list-style: none;
        padding-left: 0;
        background: rgba(0, 102, 204, 0.03);
    }

    #primary-menu .sub-menu a {
        padding-left: 3rem;
        font-size: 1rem;
    }

    /* Mobile Search */
    .header-search {
        display: none;
    }

    .mobile-search {
        padding: 1.5rem 2rem;
        border-top: 2px solid rgba(0, 102, 204, 0.1);
        margin-top: auto;
    }

    .mobile-search .search-form {
        display: flex;
        background: white;
        border-radius: 25px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0, 102, 204, 0.1);
    }

    .mobile-search .search-field {
        flex: 1;
        border: none;
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        outline: none;
    }

    .mobile-search .search-submit {
        background: var(--primary-blue);
        color: white;
        border: none;
        padding: 0.8rem 1.5rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.3s ease;
    }

    .mobile-search .search-submit:hover {
        background: var(--dark-blue);
    }

    /* Social Links in Mobile Menu */
    .mobile-social {
        padding: 2rem;
        display: flex;
        justify-content: center;
        gap: 1rem;
    }

    .mobile-social a {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-blue);
        color: white;
        border-radius: 50%;
        transition: transform 0.3s ease;
    }

    .mobile-social a:hover {
        transform: scale(1.1);
    }

    /* Add padding to body when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* Page content adjustment for fixed header */
    #page {
        padding-top: 70px;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tablet Adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-container {
        padding: 1rem 2rem;
    }

    .main-navigation ul {
        gap: 1rem;
    }

    .main-navigation a {
        font-size: 0.95rem;
    }
}

/* Desktop - Hide Mobile Elements */
@media (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }

    .menu-backdrop {
        display: none !important;
    }

    .mobile-search {
        display: none !important;
    }

    .mobile-social {
        display: none !important;
    }

    .main-navigation {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        padding-top: 0 !important;
    }

    #primary-menu {
        display: flex !important;
        align-items: center;
        gap: 2rem;
    }

    #primary-menu li {
        border: none !important;
        opacity: 1 !important;
        animation: none !important;
    }

    #primary-menu a {
        padding: 0.5rem 1rem !important;
        font-size: 1rem !important;
    }

    #primary-menu a::before {
        display: none !important;
    }
}