/* Custom underline effect */
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* Mobile menu container - Hidden by default on all screens */
.mobile-menu-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    width: 80%;
    max-width: 320px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Hidden on desktop by default */
    display: none;
}

/* Show mobile menu container only on mobile screens */
@media (max-width: 768px) {
    .mobile-menu-container {
        display: flex;
    }
}

.mobile-menu-container.open {
    transform: translateX(0);
}

/* Mobile menu header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid #f0e2e2;
    overflow: visible; 
    color: white;
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-img {
    height: 2.5rem;
    width: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: white;
    padding: 4px;
    flex-shrink: 0;
}

.logo-text {
    line-height: 1.2;
    min-width: 0;
}

.company-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-tagline {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-menu-close {
    padding: 0.4rem;
    border-radius: 50%; 
    color: #fff; 
    background: linear-gradient(135deg, #1e3a8a, #2563eb); 
    border: none;
    cursor: pointer;
    transition: background 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    font-size: 1rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3); 
    margin-right: 0.25rem;
}

.mobile-menu-close:hover {
    background: linear-gradient(135deg, #2563eb, #3b82f6); 
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

.mobile-menu-close:active {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
}

/* Mobile menu content */
.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    color: #374151;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.menu-link:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
    border-left-color: #1d4ed8;
    transform: translateX(4px);
}

.menu-link.active {
    background-color: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
    border-left-color: #1d4ed8;
}

.menu-link:active {
    transform: scale(0.98);
}

.menu-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: #3b82f6;
    flex-shrink: 0;
}

/* Mobile menu overlay - Hidden by default */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    /* Hidden on desktop by default */
    display: none;
}

/* Show overlay only on mobile screens */
@media (max-width: 768px) {
    .mobile-menu-overlay {
        display: block;
    }
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Animation for menu items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-items a {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

.menu-items a:nth-child(1) { animation-delay: 0.05s; }
.menu-items a:nth-child(2) { animation-delay: 0.1s; }
.menu-items a:nth-child(3) { animation-delay: 0.15s; }
.menu-items a:nth-child(4) { animation-delay: 0.2s; }
.menu-items a:nth-child(5) { animation-delay: 0.25s; }
.menu-items a:nth-child(6) { animation-delay: 0.3s; }
.menu-items a:nth-child(7) { animation-delay: 0.35s; }
.menu-items a:nth-child(8) { animation-delay: 0.4s; }

/* Smooth transitions */
.transition-slow {
    transition: all 0.3s ease;
}

/* Additional responsive improvements */
@media (max-width: 480px) {
    .mobile-menu-container {
        width: 90%;
        max-width: none;
    }
    
    .mobile-menu-header {
        padding: 1rem 1rem;
    }
    
    .company-name {
        font-size: 1rem;
    }
    
    .company-tagline {
        font-size: 0.65rem;
    }
    
    .mobile-menu-content {
        padding: 1rem;
    }
    
    .menu-link {
        padding: 0.625rem 0.875rem;
    }
}

/* Ensure body doesn't scroll when menu is open */
body.menu-open {
    overflow: hidden;
    /* Removed position: fixed to prevent automatic scroll to top */
}
