/* =====================================================
   NAVBAR SPECIFIC STYLES
   ===================================================== */

/* === NAVBAR BASE === */
.navbar {
    background:
        linear-gradient(135deg,
            rgba(168, 115, 186, 0.95) 0%,
            rgba(184, 132, 196, 0.9) 50%,
            rgba(212, 165, 224, 0.85) 100%),
        url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(20px) saturate(1.2);
    padding: var(--spacing-sm) var(--spacing-lg);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid var(--primary-light);
    position: relative;
    z-index: 1000;
}

.navbar-nav {
    align-items: baseline;
}

.navbar-brand {
    padding: 0;
    position: relative;
    z-index: 2;
}

.navbar-logo {
    height: 48px;
    width: auto;
    max-width: 180px;
    transition: none;
}

/* === NAVIGATION LINKS === */
.nav-link {
    color: var(--text-white) !important;
    margin: 0 var(--spacing-md);
    font-weight: 600;
    font-size: var(--font-size-lg);
    transition: var(--transition-slow);
    position: relative;
    padding: var(--spacing-sm) var(--spacing-md) !important;
    border-radius: var(--border-radius-lg);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.nav-link:hover {
    color: var(--text-white) !important;
    background: var(--bg-glass);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.nav-link::before {
    content: '✨';
    position: absolute;
    left: 50%;
    top: -8px;
    transform: translateX(-50%) scale(0);
    color: var(--accent-light);
    font-size: var(--font-size-sm);
    transition: var(--transition-normal);
}

.nav-link:hover::before {
    transform: translateX(-50%) scale(1);
}

/* === REGULAR NAV LINK ACTIVE STATE === */
.nav-link.active {
    background: var(--bg-glass);
    color: var(--text-white) !important;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
}

.nav-link.active::before {
    transform: translateX(-50%) scale(1);
    color: var(--accent-light);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
    transform: translateX(-50%);
    animation: active-underline 2s ease-in-out infinite alternate;
}

@keyframes active-underline {
    0% { opacity: 0.6; width: 60%; }
    100% { opacity: 1; width: 80%; }
}

/* === AUTH LINKS === */
.auth-link {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-md) !important;
    margin: 0 var(--spacing-xs);
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    font-weight: 600;
    font-size: var(--font-size-base);
}

.login-link {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
}

.login-link:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-md);
}

.register-link {
    background: transparent;
    border-color: var(--accent-light);
}

.register-link:hover {
    background: var(--bg-glass);
    border-color: var(--accent-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-sm);
}

/* === ACTIVE STATE STYLES === */
.auth-link.active {
    position: relative;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-width: 2px;
}

.login-link.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(168, 115, 186, 0.4), var(--shadow-lg);
    animation: active-glow 2s ease-in-out infinite alternate;
}

.register-link.active {
    background: linear-gradient(135deg, var(--accent-color), rgba(255, 255, 255, 0.2));
    border-color: var(--primary-color);
    color: var(--text-primary) !important;
    box-shadow: 0 0 15px rgba(212, 165, 224, 0.5), var(--shadow-md);
    animation: active-pulse 2s ease-in-out infinite alternate;
}

.active-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    animation: active-sparkle 1.5s ease-in-out infinite;
}

.active-indicator::before {
    content: '✨';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #ffd700;
    animation: sparkle-dance 2s linear infinite;
}

@keyframes active-glow {
    0% {
        box-shadow: 0 0 20px rgba(168, 115, 186, 0.4), var(--shadow-lg);
        border-color: var(--accent-color);
    }
    100% {
        box-shadow: 0 0 30px rgba(168, 115, 186, 0.6), var(--shadow-xl);
        border-color: var(--accent-light);
    }
}

@keyframes active-pulse {
    0% {
        box-shadow: 0 0 15px rgba(212, 165, 224, 0.5), var(--shadow-md);
        transform: translateY(-2px) scale(1);
    }
    100% {
        box-shadow: 0 0 25px rgba(212, 165, 224, 0.7), var(--shadow-lg);
        transform: translateY(-2px) scale(1.02);
    }
}

@keyframes active-sparkle {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes sparkle-dance {
    0% { transform: translateX(-50%) rotate(0deg) scale(1); }
    25% { transform: translateX(-50%) rotate(90deg) scale(1.2); }
    50% { transform: translateX(-50%) rotate(180deg) scale(0.8); }
    75% { transform: translateX(-50%) rotate(270deg) scale(1.1); }
    100% { transform: translateX(-50%) rotate(360deg) scale(1); }
}

@keyframes mobile-active-glow {
    0% {
        box-shadow: 0 0 15px rgba(168, 115, 186, 0.3), var(--shadow-md);
    }
    100% {
        box-shadow: 0 0 25px rgba(168, 115, 186, 0.5), var(--shadow-lg);
    }
}

@keyframes mobile-active-pulse {
    0% {
        box-shadow: 0 0 10px rgba(212, 165, 224, 0.4), var(--shadow-sm);
    }
    100% {
        box-shadow: 0 0 20px rgba(212, 165, 224, 0.6), var(--shadow-md);
    }
}

/* === RESPONSIVE NAVBAR === */
.navbar-toggler {
    border: 2px solid var(--accent-light);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-xs);
    transition: var(--transition-normal);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem var(--bg-secondary);
}

.navbar-toggler:hover {
    background-color: var(--bg-glass);
    border-color: var(--accent-color);
}

.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, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 24px;
    height: 24px;
}

/* === RESPONSIVE NAVBAR === */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: block;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-glass);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
        box-shadow: var(--shadow-lg);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-normal);
        z-index: 999;
    }

    .navbar-collapse.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .navbar-nav {
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-sm);
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: var(--spacing-md);
        border-radius: var(--border-radius-md);
    }

    .auth-link {
        margin: var(--spacing-xs) 0;
        padding: var(--spacing-md) !important;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-xs);
    }

    .auth-link.active {
        transform: none;
        animation: none;
    }

    .login-link.active {
        animation: mobile-active-glow 3s ease-in-out infinite alternate;
    }

    .register-link.active {
        animation: mobile-active-pulse 3s ease-in-out infinite alternate;
    }

    .active-indicator {
        top: -5px;
        right: -5px;
        width: 10px;
        height: 10px;
    }

    .nav-link.active::after {
        animation: none;
        opacity: 1;
    }

    /* Dropdown responsive styles */
    .dropdown {
        width: 100%;
    }

    .dropdown-menu-custom {
        position: static !important;
        transform: none !important;
        width: 100%;
        margin: 0.5rem 0;
        box-shadow: 0 5px 20px rgba(168, 115, 186, 0.3);
    }

    .dropdown-menu-custom .dropdown-item {
        text-align: center;
        justify-content: center;
    }

    .dropdown-menu-custom .dropdown-item:hover {
        transform: translateX(0) scale(1.02);
    }

    /* Profile dropdown mobile */
    .profile-menu {
        position: static !important;
        width: 100%;
        margin-top: var(--spacing-sm);
    }

    .profile-menu-header {
        text-align: center;
    }

    .profile-info {
        flex-direction: column;
        text-align: center;
    }

    .profile-details {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: var(--spacing-sm) 0;
    }

    .navbar-logo {
        height: 40px;
        max-width: 160px;
    }
}


/* === DROPDOWN MENU STYLES === */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-right: 0.3rem;
    vertical-align: 0.15em;
    content: "";
    border-top: 0.3em solid;
    border-left: 0.3em solid transparent;
    border-right: 0.3em solid transparent;
    transition: transform 0.3s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.dropdown-menu-custom {
    background: linear-gradient(135deg,
        rgba(168, 115, 186, 0.98) 0%,
        rgba(184, 132, 196, 0.95) 50%,
        rgba(212, 165, 224, 0.92) 100%);
    backdrop-filter: blur(20px) saturate(1.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(168, 115, 186, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
    min-width: 220px;
    margin-top: 0.5rem;
    transform-origin: top;
    animation: dropdown-appear 0.3s ease-out;
}

@keyframes dropdown-appear {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-menu-custom .dropdown-item {
    color: var(--text-white);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: var(--font-size-base);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
}

.dropdown-menu-custom .dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent);
    transition: left 0.6s ease;
}

.dropdown-menu-custom .dropdown-item:hover::before {
    left: 100%;
}

.dropdown-menu-custom .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--text-white);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.dropdown-menu-custom .dropdown-item:active {
    background: rgba(255, 255, 255, 0.3);
}

.dropdown-menu-custom .dropdown-item i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.dropdown-menu-custom .dropdown-item:hover i {
    transform: scale(1.2) rotate(10deg);
}

/* Dropdown divider (if needed) */
.dropdown-menu-custom .dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
}

/* === PROFILE ICON & IMAGE === */
.profile-icon-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.profile-icon-wrapper:hover {
    transform: scale(1.1);
}

.profile-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(135deg,
        var(--primary-color),
        var(--secondary-color));
    box-shadow: 0 4px 15px rgba(168, 115, 186, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: var(--transition-normal);
}

.profile-icon-wrapper:hover .profile-image {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 25px rgba(168, 115, 186, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Profile status dot (online indicator) */
.profile-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #4CAF50, #81C784);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.6);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 2px 12px rgba(76, 175, 80, 0.8);
    }
}

/* === PROFILE DROPDOWN MENU === */
.profile-dropdown {
    position: relative;
}

.profile-dropdown .dropdown-menu {
    position: absolute;
    left: auto !important;
    right: -195px !important;
    transform: none !important;
}

.profile-menu {
    min-width: 280px;
    padding: 0;
    margin-top: var(--spacing-sm);
    left: auto !important;
    right: 0 !important;
}

.profile-menu-header {
    padding: var(--spacing-md);
    background: linear-gradient(135deg,
        rgba(168, 115, 186, 0.95) 0%,
        rgba(184, 132, 196, 0.9) 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.15));
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-white);
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Profile avatar large for dropdown header */
.profile-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg,
        var(--primary-color),
        var(--secondary-color));
    position: relative;
}

.profile-avatar-large::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1),
        transparent);
    pointer-events: none;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-email {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.profile-menu .dropdown-divider {
    margin: 0;
    border-color: rgba(168, 115, 186, 0.2);
}

.profile-menu .dropdown-item {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
}

.profile-menu .dropdown-item i {
    font-size: var(--font-size-lg);
    width: 24px;
    text-align: center;
}

.logout-item {
    color: #dc3545 !important;
    font-weight: 600;
}

.logout-item:hover {
    background: rgba(220, 53, 69, 0.1) !important;
    color: #dc3545 !important;
}

.logout-item i {
    color: #dc3545;
}
