/* Navbar specific styles */
.mobile-user-section {
    background: #414141;
}

.navbar {
    padding: 0.5rem 0;
    width: 90%;
    justify-self: center;
    position: fixed;
    z-index: 1030;
    background-color: #ffffffc7;
    backdrop-filter: blur(4px);
    height: 80px;
}

.navbar-brand {
    padding: 0;
}

.navbar-nav .nav-link {
    color: #374151 !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin: 0 0.1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.1);
}

.navbar-nav .dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0.5rem;
}

/* ===== DESKTOP STYLES ===== */
@media (min-width: 992px) {

    /* Fixed Desktop Navbar */
    .glass-navbar {
        background: rgb(255 255 255 / 65%) !important;
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 0 0 20px 20px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        padding: 0.8rem 0;
        min-height: 70px;
        transition: all 0.3s ease;
    }

    /* Fixed Logo - Prevent Stretching */
    .navbar-brand .logo {
        height: 35px;
        width: auto;
        max-height: 35px;
        object-fit: contain;
        transition: all 0.3s ease;
    }

    .navbar-brand:hover .logo {
        transform: scale(1.05);
    }

    /* Clean Navigation Items - No Background */
    .desktop-nav .navbar-nav .nav-link {
        padding: 10px 16px !important;
        font-weight: 500;
        color: #495057 !important;
        border-radius: 8px;
        transition: all 0.3s ease;
        position: relative;
        margin: 0 2px;
        background: transparent !important;
        border: none !important;
    }

    .desktop-nav .navbar-nav .nav-link:hover,
    .desktop-nav .navbar-nav .nav-link.active {
        color: #2c5aa0 !important;
        background: rgba(74, 144, 226, 0.1) !important;
        transform: translateY(-1px);
    }

    .desktop-nav .navbar-nav .nav-link::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 50%;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, #4a90e2, #67b26f);
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .desktop-nav .navbar-nav .nav-link:hover::after,
    .desktop-nav .navbar-nav .nav-link.active::after {
        width: 70%;
    }

    /* Enhanced "More" Dropdown */
    .enhanced-more-dropdown {
        position: relative;
        transition: all 0.3s ease;
    }

    .enhanced-more-dropdown:hover {
        color: #4a90e2 !important;
    }

    .enhanced-dropdown {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 16px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
        padding: 8px;
        min-width: 280px;
        transform-origin: top;
        animation: dropdownSlide 0.3s ease-out;
    }

    @keyframes dropdownSlide {
        0% {
            opacity: 0;
            transform: translateY(-10px) scale(0.95);
        }

        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    .enhanced-dropdown-item {
        padding: 12px 16px;
        border-radius: 12px;
        margin: 4px 0;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: #495057;
        position: relative;
        overflow: hidden;
    }

    .enhanced-dropdown-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(74, 144, 226, 0.1), transparent);
        transition: left 0.5s;
    }

    .enhanced-dropdown-item:hover::before {
        left: 100%;
    }

    .enhanced-dropdown-item:hover {
        background: rgba(74, 144, 226, 0.08);
        transform: translateX(8px);
        color: #2c5aa0;
    }

    .dropdown-icon {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(74, 144, 226, 0.1);
        border-radius: 10px;
        transition: all 0.3s ease;
    }

    .enhanced-dropdown-item:hover .dropdown-icon {
        background: rgba(74, 144, 226, 0.2);
        transform: scale(1.1);
    }

    .dropdown-icon i {
        color: #4a90e2;
        font-size: 1.1rem;
    }

    .dropdown-text {
        flex: 1;
    }

    .dropdown-title {
        font-weight: 600;
        color: #2c3e50;
        display: block;
        font-size: 0.9rem;
    }

    .dropdown-desc {
        color: #6c757d;
        font-size: 0.75rem;
        display: block;
        margin-top: 2px;
    }

    /* Language Selector */
    .language-selector {
        margin-right: 12px;
    }

    .language-selector .glass-btn {
        border-radius: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
        font-weight: 500;
        min-width: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .language-text {
        font-weight: 600;
    }

    .language-option {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-radius: 6px;
        transition: all 0.3s ease;
    }

    .language-option.active {
        background: rgba(74, 144, 226, 0.1);
        color: #2c5aa0;
        font-weight: 500;
    }

    .language-option:hover:not(.active) {
        background: rgba(0, 0, 0, 0.05);
    }

    .language-flag {
        font-size: 1.1rem;
    }

    /* Desktop User Menu - Fixed Size */
    .desktop-user-menu {
        margin-left: 0;
    }

    .desktop-user-menu .glass-btn {
        border-radius: 10px;
        padding: 8px 16px;
        font-size: 0.9rem;
        font-weight: 500;
        min-height: 40px;
        min-width: 140px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .desktop-user-menu .dropdown-toggle-split {
        padding: 8px 8px;
        min-height: 40px;
        min-width: 40px;
    }

    /* Desktop Badges */
    .desktop-badge {
        font-size: 0.75rem;
        padding: 6px 10px;
        border-radius: 8px;
        font-weight: 600;
        min-width: 80px;
        text-align: center;
    }

    /* Fixed Desktop Login Button - Consistent Size */
    .desktop-login-btn {
        border-radius: 10px;
        padding: 8px 20px;
        font-weight: 500;
        transition: all 0.3s ease;
        min-height: 40px;
        min-width: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .desktop-login-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
    }

    /* Ensure consistent navbar height */
    .desktop-nav .d-flex {
        min-height: 40px;
    }

    /* Ensure mobile styles don't affect desktop */
    .mobile-nav-header,
    .mobile-offcanvas {
        display: none !important;
    }
}

.d-nav {
    max-width: 98%;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 991.98px) {
    .glass-navbar {
        min-height: 50px !important;
        padding: 0.3rem 0 !important;
        width: 100% !important;
    }

    .d-nav {
        max-width: none;
    }

    .navbar-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0 !important;
    }

    .navbar-brand .logo {
        height: 26px;
        width: auto;
        max-height: 26px;
        object-fit: contain;
    }

    .mobile-nav-header {
        width: 100%;
        justify-content: flex-end;
        padding: 0 15px;
    }

    .container {
        position: relative;
        min-height: 50px;
    }

    /* Hide desktop nav on mobile */
    .desktop-nav {
        display: none !important;
    }
}

/* ===== SHARED GLASS STYLES ===== */
.glass-btn {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.3);
}

.glass-btn-primary {
    background: rgba(74, 144, 226, 0.2);
    border: 1px solid rgba(74, 144, 226, 0.3);
    color: #2c5aa0;
    font-weight: 500;
}

.glass-btn-outline-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.4);
    color: #6c757d;
}

.glass-btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #495057;
}

.glass-badge {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-weight: 500;
    padding: 4px 8px;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.glass-badge-primary {
    background: rgba(74, 144, 226, 0.25);
    color: #2c5aa0;
}

.glass-badge-success {
    background: rgba(40, 167, 69, 0.25);
    color: #1e7e34;
}

.glass-badge-warning {
    background: rgba(255, 193, 7, 0.25);
    color: #856404;
}

.glass-badge-danger {
    background: rgba(220, 53, 69, 0.25);
    color: #721c24;
}

/* Improved Menu Toggle Icon */
.mobile-menu-toggle {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-menu-icon {
    display: flex;
    flex-direction: column;
    width: 20px;
    height: 16px;
    justify-content: space-between;
    position: relative;
}

.menu-line {
    display: block;
    height: 2px;
    background: #495057;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Clean X Animation */
.mobile-menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mobile-menu-toggle:hover .menu-line {
    background: #4a90e2;
}

/* Fixed Mobile Offcanvas */
.mobile-offcanvas {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    width: 320px;
    max-width: 85vw;
}

.mobile-offcanvas-body {
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
}

/* Single Close Button */
.mobile-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px;
}

.mobile-close-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #495057;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2c5aa0;
    transform: translateX(-2px);
}

.mobile-close-btn i {
    font-size: 0.9rem;
}

/* Modal Styles (unchanged) */
.compact-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    margin: 0 auto;
}

.compact-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(103, 178, 111, 0.1));
    position: relative;
}

.compact-modal-hero {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compact-modal-hero i {
    font-size: 1.8rem;
    color: #4a90e2;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border-radius: 50%;
}

.compact-modal-title {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    font-size: 1.1rem;
}

.compact-close-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #6c757d;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.compact-modal-body {
    padding: 20px;
}

.compact-auth-btn {
    border-radius: 12px;
    padding: 12px 20px;
    border: none;
    background: linear-gradient(135deg, #4a90e2, #67b26f);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
    font-size: 0.9rem;
}

.compact-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
    color: white;
    text-decoration: none;
}

.compact-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider-text {
    background: white;
    padding: 0 12px;
    color: #6c757d;
    font-size: 0.8rem;
    position: relative;
    z-index: 2;
}

.compact-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.compact-register-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.compact-register-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.compact-register-option:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    color: #495057;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.student-option:hover {
    border-left: 4px solid #4a90e2;
}

.studio-option:hover {
    border-left: 4px solid #28a745;
}

.maker-option:hover {
    border-left: 4px solid #ffc107;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-content i {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
}

.student-option i {
    color: #4a90e2;
}

.studio-option i {
    color: #28a745;
}

.maker-option i {
    color: #ffc107;
}

.option-text {
    display: flex;
    flex-direction: column;
}

.option-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.option-desc {
    color: #6c757d;
    font-size: 0.75rem;
}

.option-arrow {
    color: #6c757d;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.compact-register-option:hover .option-arrow {
    transform: translateX(3px);
    color: #4a90e2;
}

.compact-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.5);
}

/* Ripple Effect */
.glass-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: glassRipple 0.6s ease-out;
    pointer-events: none;
}

@keyframes glassRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.glass-btn,
.compact-auth-btn,
.compact-register-option {
    position: relative;
    overflow: hidden;
}