/* ===== MODERN MOBILE NAVIGATION ===== */

/* Mobile Nav Toggle Button */
.mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    position: relative;
    z-index: 9999;
    transition: all 0.3s ease;
}

.mobile-nav-toggle:focus {
    outline: none;
}

.mobile-nav-toggle .hamburger-line {
    width: 24px;
    height: 3px;
    background-color: var(--primary-color, #003366);
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background-color: #fff;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background-color: #fff;
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-container {
    position: relative;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin-left: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.mobile-nav-overlay.active .mobile-nav-container {
    transform: translateX(0);
}

/* Mobile Nav Header */
.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary-color, #003366) 0%, #0056b3 100%);
    color: white;
    min-height: 80px;
}

.mobile-nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-nav-logo .logo-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.mobile-nav-logo .logo-text {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mobile-nav-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Search */
.mobile-search {
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-input-group {
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-input-group input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 16px;
    background: white;
    outline: none;
}

.search-input-group input::placeholder {
    color: #6c757d;
}

.search-input-group button {
    background: var(--primary-color, #003366);
    border: none;
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-input-group button:hover {
    background: #0056b3;
}

/* Mobile Navigation Menu */
.mobile-nav-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    position: relative;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.mobile-nav-link:hover {
    background: linear-gradient(90deg, rgba(0, 51, 102, 0.05) 0%, transparent 100%);
    color: var(--primary-color, #003366);
}

.mobile-nav-link i {
    width: 24px;
    margin-right: 16px;
    font-size: 18px;
    color: var(--primary-color, #003366);
    text-align: center;
}

.mobile-nav-link span {
    flex: 1;
    font-size: 16px;
}

.submenu-arrow {
    margin-left: auto !important;
    margin-right: 0 !important;
    font-size: 14px !important;
    transition: transform 0.2s ease;
    color: #6c757d !important;
}

.mobile-nav-item.has-submenu.active .submenu-arrow {
    transform: rotate(90deg);
}

/* Mobile Submenu */
.mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f8f9fa;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav-item.has-submenu.active .mobile-submenu {
    max-height: 300px;
}

.mobile-submenu li {
    border-top: 1px solid #e9ecef;
}

.mobile-submenu a {
    display: block;
    padding: 14px 24px 14px 60px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;
}

.mobile-submenu a:hover {
    background: white;
    color: var(--primary-color, #003366);
    padding-left: 64px;
}

/* Mobile User Section */
.mobile-user-section {
    margin-top: auto;
    padding: 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.mobile-user-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color, #003366) 0%, #0056b3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 16px;
    font-size: 20px;
}

.user-details {
    flex: 1;
}

.user-name {
    display: block;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.user-status {
    font-size: 14px;
    color: #6c757d;
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-mobile-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 2px solid var(--primary-color, #003366);
    background: white;
    color: var(--primary-color, #003366);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn-mobile-action:hover {
    background: var(--primary-color, #003366);
    color: white;
}

.btn-mobile-action.logout {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-mobile-action.logout:hover {
    background: #dc3545;
    color: white;
}

.logout-form {
    margin: 0;
}

.logout-form button {
    width: 100%;
    border: none;
    font-family: inherit;
}

/* Mobile Auth Actions */
.mobile-auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-mobile-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color, #003366) 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.2s ease;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.3);
}

.btn-mobile-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.4);
    color: white;
}

.btn-mobile-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: 2px solid var(--primary-color, #003366);
    background: white;
    color: var(--primary-color, #003366);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn-mobile-secondary:hover {
    background: var(--primary-color, #003366);
    color: white;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 480px) {
    .mobile-nav-container {
        width: 100%;
        max-width: 100%;
    }
}

/* Prevent body scroll when menu is open */
body.mobile-nav-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Animation for smooth entries */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-nav-overlay.active .mobile-nav-item {
    animation: fadeInUp 0.3s ease forwards;
}

.mobile-nav-overlay.active .mobile-nav-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-nav-overlay.active .mobile-nav-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-nav-overlay.active .mobile-nav-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-nav-overlay.active .mobile-nav-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-nav-overlay.active .mobile-nav-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-nav-overlay.active .mobile-nav-item:nth-child(6) { animation-delay: 0.35s; }

/* Hide on desktop */
@media (min-width: 1200px) {
    .mobile-nav-toggle,
    .mobile-nav-overlay {
        display: none !important;
    }
}
