/* app/static/css/components/navbar.css */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all var(--transition-normal);
}

[data-theme="dark"] .navbar {
    background: rgba(13, 17, 23, 0.95);
    border-bottom-color: var(--border-dark);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark);
    transition: transform var(--transition-normal);
}

.nav-logo:hover {
    transform: scale(1.05);
    transition: .2s ease-in-out;
}

.logo-icon {
    color: var(--primary-blue);
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Desktop Navigation */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-purple));
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--primary-blue);
    background: var(--primary-blue-light);
    transition: .2s ease-in-out;
}

.nav-link:hover::before {
    width: 80%;
    transition: .2s ease-in-out;
}

.nav-link.active {
    color: var(--primary-blue);
    background: var(--primary-blue-light);
}

.nav-link.active::before {
    width: 80%;
}

/* User Section */
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    color: var(--text-dark);
}

.user-avatar:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    transition: .2s ease-in-out;
}

.user-name {
    font-weight: 500;
}

.user-avatar i:last-child {
    font-size: 0.75rem;
    transition: transform var(--transition-normal);
}

.user-dropdown:hover .user-avatar i:last-child {
    transform: rotate(180deg);
    transition: .2s ease-in-out;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1001;
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transition: .2s ease-in-out;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    color: var(--text-soft);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    transition: .2s ease-in-out;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-sm) 0;
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    transition: .2s ease-in-out;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: var(--space-xl) var(--space-lg);
    z-index: 999;
    overflow-y: auto;
    border-top: 1px solid var(--border);
}

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

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-md);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--border);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link i {
    width: 20px;
    text-align: center;
    color: var(--text-soft);
    font-size: 1.125rem;
}

.mobile-nav-link:hover {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    transform: translateX(10px);
    transition: .2s ease-in-out;
}

.mobile-nav-link:hover i {
    color: var(--primary-blue);
    transition: .2s ease-in-out;
}

/* Scrolled State */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(13, 17, 23, 0.98);
}

/* Responsive Design */
@media (max-width: 1068px) {
    .nav-menu {
        display: none;
    }
    
    .nav-user .auth-buttons {
        display: none;
    }
    
    .user-dropdown {
        display: none;
    }
    
    .nav-container {
        height: 60px;
    }
    
    .mobile-menu {
        top: 60px;
        height: calc(100vh - 60px);
    }
}

@media (min-width: 1069px) {
    .hamburger {
        display: none;
    }
    
    .mobile-menu {
        display: none;
    }
}

/* Animation for navbar items */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-link {
    animation: slideIn 0.6s ease forwards;
}

.nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav-link:nth-child(2) { animation-delay: 0.2s; }
.nav-link:nth-child(3) { animation-delay: 0.3s; }
.nav-link:nth-child(4) { animation-delay: 0.4s; }
.nav-link:nth-child(5) { animation-delay: 0.5s; }
/* static/css/components/notifications.css - UPDATED WITH TOP BADGE */
.notification-bell {
    position: relative;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 40px;
}

.notification-bell:hover {
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.notification-bell.has-unread {
    animation: bell-shake 0.5s ease-in-out;
}

@keyframes bell-shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* TOP-POSITIONED BADGE */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 0px; /* Adjust to be at top-right of bell */
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-pop 0.3s ease;
    pointer-events: none;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--surface); /* Creates a border effect */
    z-index: 10;
}

/* Red color override - make sure it's bright red */
.notification-badge {
    background: #ff4757 !important; /* Bright red */
    color: white !important;
}

@keyframes badge-pop {
    0% { transform: scale(0) translateY(-10px); opacity: 0; }
    70% { transform: scale(1.1) translateY(0); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Red pulse animation for unread notifications */
.notification-pulse {
    animation: red-pulse 2s infinite;
}

@keyframes red-pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7),
                    0 0 0 2px var(--surface); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface);
    }
}

/* Mobile Notification Badge - also at top */
.mobile-notification-badge {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #ff4757;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--surface);
}

/* Dark theme adjustments */
[data-theme="dark"] .notification-badge {
    box-shadow: 0 0 0 2px var(--surface-dark);
}

[data-theme="dark"] .notification-pulse {
    animation: red-pulse-dark 2s infinite;
}

@keyframes red-pulse-dark {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7),
                    0 0 0 2px var(--surface-dark); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface-dark);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0),
                    0 0 0 2px var(--surface-dark);
    }
}

[data-theme="dark"] .mobile-notification-badge {
    box-shadow: 0 0 0 2px var(--surface-dark);
}

/* Bell animation when new notification arrives */
@keyframes bell-ring {
    0% { transform: rotate(0); }
    10% { transform: rotate(-15deg); }
    20% { transform: rotate(10deg); }
    30% { transform: rotate(-10deg); }
    40% { transform: rotate(5deg); }
    50% { transform: rotate(-5deg); }
    60% { transform: rotate(2deg); }
    70% { transform: rotate(-2deg); }
    80% { transform: rotate(1deg); }
    90% { transform: rotate(-1deg); }
    100% { transform: rotate(0); }
}

.notification-new {
    animation: bell-ring 1s ease;
}

/* Hover effect for bell */
.notification-bell::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    bottom: -8px;
    left: -8px;
    border-radius: 50%;
    background: var(--primary-blue-light);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.notification-bell:hover::after {
    opacity: 0.3;
}

/* Responsive: Hide desktop bell on mobile, show mobile link */
@media (max-width: 768px) {
    .notification-bell {
        display: none;
    }
    
    .mobile-nav-link {
        position: relative;
    }
}

/* Add to navbar.css to ensure proper spacing */
.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
}

/* Make sure the bell icon has enough space for the badge */
.notification-bell i {
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}