/* =========================================
   MOBILE NAVIGATION STYLES
   ========================================= */

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    /* Pure white background */
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-sidebar.active {
    left: 0;
}

/* Mobile Sidebar Header */
.mobile-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-sidebar__logo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
}

.mobile-sidebar__brand-text {
    display: flex;
    flex-direction: column;
}

.mobile-sidebar__university-name {
    font-family: var(--font-primary);
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
}

.mobile-sidebar__university-sub {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-sidebar__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-sidebar__close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Mobile Sidebar Navigation */
.mobile-sidebar__nav {
    padding: 16px 0;
}

.mobile-sidebar__section {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-gray-200);
}

.mobile-sidebar__section:last-of-type {
    border-bottom: none;
}

.mobile-sidebar__section-title {
    padding: 12px 20px 8px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* Mobile Sidebar Links */
.mobile-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    margin: 4px 12px;
    color: var(--color-gray-700);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

/* Button-like background effect */
.mobile-sidebar__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.08) 0%,
            rgba(37, 99, 235, 0.12) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.mobile-sidebar__link i {
    font-size: 18px;
    color: var(--color-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__link:hover {
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.1) 0%,
            rgba(37, 99, 235, 0.05) 100%);
    color: var(--color-primary);
    padding-left: 24px;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.mobile-sidebar__link:hover::before {
    width: 100%;
}

.mobile-sidebar__link:hover i {
    transform: scale(1.15) rotate(5deg);
    color: var(--color-secondary);
}

.mobile-sidebar__link:active {
    transform: translateX(2px) scale(0.98);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.mobile-sidebar__link--small {
    padding: 10px 20px;
    font-size: 14px;
}

.mobile-sidebar__link--small i {
    font-size: 16px;
}

/* Mobile Sidebar Dropdown */
.mobile-sidebar__dropdown {
    margin: 4px 12px;
}

.mobile-sidebar__dropdown-toggle {
    width: calc(100% - 24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin: 0 12px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--color-gray-700);
    font-family: var(--font-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

/* Button-like background for dropdown toggle */
.mobile-sidebar__dropdown-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(37, 99, 235, 0.08) 0%,
            rgba(37, 99, 235, 0.12) 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.mobile-sidebar__dropdown-toggle span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-sidebar__dropdown-toggle i:first-child {
    font-size: 18px;
    color: var(--color-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__chevron {
    font-size: 14px;
    color: var(--color-gray-500);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__dropdown-toggle:hover {
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.1) 0%,
            rgba(37, 99, 235, 0.05) 100%);
    color: var(--color-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.mobile-sidebar__dropdown-toggle:hover::before {
    width: 100%;
}

.mobile-sidebar__dropdown-toggle:hover i:first-child {
    transform: scale(1.15) rotate(5deg);
}

.mobile-sidebar__dropdown-toggle:active {
    transform: translateX(2px) scale(0.98);
}

.mobile-sidebar__dropdown-toggle.active {
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.12) 0%,
            rgba(37, 99, 235, 0.08) 100%);
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.mobile-sidebar__dropdown-toggle.active .mobile-sidebar__chevron {
    transform: rotate(180deg);
    color: var(--color-secondary);
}

.mobile-sidebar__dropdown-toggle.active i:first-child {
    color: var(--color-secondary);
}

/* Mobile Sidebar Dropdown Menu */
.mobile-sidebar__dropdown-menu {
    max-height: 0;
    overflow: hidden;
    background: transparent;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 12px;
}

.mobile-sidebar__dropdown-menu.active {
    max-height: 500px;
    padding: 8px 12px;
}

.mobile-sidebar__dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 12px 40px;
    margin: 4px 0;
    color: var(--color-gray-600);
    text-decoration: none;
    font-family: var(--font-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.mobile-sidebar__dropdown-item::before {
    content: '';
    position: absolute;
    left: 20px;
    width: 4px;
    height: 4px;
    background: var(--color-gray-400);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__dropdown-item i {
    font-size: 16px;
    color: var(--color-secondary);
    margin-left: -20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar__dropdown-item:hover {
    background: linear-gradient(135deg,
            rgba(37, 99, 235, 0.08) 0%,
            rgba(37, 99, 235, 0.04) 100%);
    color: var(--color-primary);
    padding-left: 44px;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.mobile-sidebar__dropdown-item:hover::before {
    background: var(--color-secondary);
    transform: scale(1.8);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

.mobile-sidebar__dropdown-item:hover i {
    transform: scale(1.1) rotate(5deg);
}

.mobile-sidebar__dropdown-item:active {
    transform: translateX(2px) scale(0.98);
}

.mobile-sidebar__divider {
    height: 1px;
    background: var(--color-gray-300);
    margin: 8px 20px 8px 40px;
}

/* Mobile Sidebar CTA */
.mobile-sidebar__cta {
    padding: 20px;
}

.btn--block {
    width: 100%;
    justify-content: center;
}

/* Mobile Sidebar Social */
.mobile-sidebar__social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--color-gray-200);
}

.mobile-sidebar__social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
    border-radius: var(--radius-md);
    color: var(--color-gray-600);
    font-size: 18px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.mobile-sidebar__social-link:hover {
    background: var(--color-secondary);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* Hamburger to X Animation */
.nav__toggle.active .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6l18 18M6 24L24 6'/%3e%3c/svg%3e");
}

.header.scrolled .nav__toggle.active .navbar-toggler-icon,
.header--solid .nav__toggle.active .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2851, 65, 85, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6l18 18M6 24L24 6'/%3e%3c/svg%3e");
}

/* Hide desktop quick sidebar on mobile */
@media (max-width: 991px) {
    .quick-sidebar {
        display: none !important;
    }

    .nav__toggle {
        display: flex !important;
    }

    /* Hide Bootstrap collapse menu on mobile - use custom sidebar instead */
    .navbar-collapse {
        display: none !important;
    }

    .nav__menu {
        display: none !important;
    }
}

/* Enhanced Mobile Sidebar Effects */
.mobile-sidebar {
    /* Ensure white background everywhere - no gradient */
    background: #ffffff !important;
}

.mobile-sidebar__header {
    /* Enhanced gradient with animation */
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.15);
}

/* Add smooth entrance animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mobile-sidebar.active {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced link hover effects */
.mobile-sidebar__link:hover,
.mobile-sidebar__dropdown-toggle:hover {
    background: linear-gradient(90deg, var(--color-gray-50) 0%, rgba(37, 99, 235, 0.05) 100%);
}

/* Add ripple effect on dropdown items */
.mobile-sidebar__dropdown-item {
    position: relative;
    overflow: hidden;
}

.mobile-sidebar__dropdown-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mobile-sidebar__dropdown-item:active::after {
    width: 300px;
    height: 300px;
}

/* Enhanced social link effects */
.mobile-sidebar__social-link {
    position: relative;
    overflow: hidden;
}

.mobile-sidebar__social-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--color-secondary);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
    z-index: -1;
}

.mobile-sidebar__social-link:hover::before {
    width: 100%;
    height: 100%;
}

/* Add glow effect to CTA button */
.mobile-sidebar__cta .btn--primary {
    position: relative;
    overflow: hidden;
}

.mobile-sidebar__cta .btn--primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.mobile-sidebar__cta .btn--primary:hover::before {
    left: 100%;
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}