/* ========================================
   MODERN NAVBAR - Glassmorphism Design
   ======================================== */

:root {
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --navbar-blur: blur(10px);
    --navbar-shadow: 0 2px 20px rgba(102, 126, 234, 0.1);
    --navbar-height: 60px;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #ff4500;
    --text-primary: #1a1a1b;
    --text-secondary: #787c7e;
    --hover-bg: rgba(102, 126, 234, 0.08);
    --active-bg: rgba(102, 126, 234, 0.12);
}

[data-theme="dark"] {
    --navbar-bg: rgba(26, 26, 27, 0.95);
    --navbar-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    --text-primary: #d7dadc;
    --text-secondary: #818384;
    --hover-bg: rgba(255, 255, 255, 0.08);
    --active-bg: rgba(255, 255, 255, 0.12);
}

/* Main Header */
.main-header {
    background: var(--navbar-bg);
    backdrop-filter: var(--navbar-blur);
    -webkit-backdrop-filter: var(--navbar-blur);
    box-shadow: var(--navbar-shadow);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

.main-header.scrolled {
    box-shadow: 0 4px 30px rgba(102, 126, 234, 0.15);
}

/* Navbar Container */
.main-header .navbar {
    padding: 0.5rem 0;
    min-height: var(--navbar-height);
}

/* Logo */
.main-header .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.main-header .logo:hover {
    transform: scale(1.05);
}

.main-header .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.main-header .logo-text {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 400;
    margin-left: 0.5rem;
}

.main-header .logo-text b {
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation Links */
.main-header .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.6rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-header .nav-link:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.main-header .nav-link.active {
    background: var(--active-bg);
    color: #667eea;
    font-weight: 600;
}

.main-header .nav-link i {
    font-size: 1.1rem;
}

/* Create Post Button (Special Styling) */
.main-header .nav-link[href="/create"] {
    color: var(--accent-color) !important;
    font-weight: 600;
}

.main-header .nav-link[href="/create"]:hover {
    background: rgba(255, 69, 0, 0.1);
    transform: translateY(-2px) scale(1.02);
}

/* Search Container */
.main-header .search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.main-header .search-container input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border: 2px solid transparent;
    border-radius: 20px;
    background: rgba(102, 126, 234, 0.05);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.main-header .search-container input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.main-header .search-container input::placeholder {
    color: var(--text-secondary);
}

.main-header .search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-header .search-btn:hover {
    color: #667eea;
    transform: translateY(-50%) scale(1.1);
}

/* Action Icons */
.main-header .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-header .action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.main-header .action-icon:hover {
    background: var(--hover-bg);
    color: #667eea;
    transform: scale(1.1);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: relative;
}

.dark-mode-toggle i {
    position: absolute;
    transition: all 0.3s ease;
}

.dark-mode-toggle .fa-moon {
    opacity: 1;
}

.dark-mode-toggle .fa-sun {
    opacity: 0;
}

[data-theme="dark"] .dark-mode-toggle .fa-moon {
    opacity: 0;
}

[data-theme="dark"] .dark-mode-toggle .fa-sun {
    opacity: 1;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4500;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* User Button */
.main-header .user-btn {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-header .user-btn:hover {
    border-color: #667eea;
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.main-header .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dropdown Menus */
.main-header .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-top: 0.5rem;
    padding: 0.5rem;
    min-width: 250px;
    background: white;
    backdrop-filter: var(--navbar-blur);
    -webkit-backdrop-filter: var(--navbar-blur);
}

[data-theme="dark"] .main-header .dropdown-menu {
    background: #1a1a1b;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* More Dropdown Specific Styling */
.main-header .nav-item.dropdown .dropdown-menu {
    min-width: 200px;
    animation: dropdown-fade-in 0.3s ease;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-header .nav-item.dropdown .dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: 0.15em;
    transition: transform 0.3s ease;
}

.main-header .nav-item.dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

.main-header .dropdown-header {
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.main-header .dropdown-header strong {
    font-size: 1.1rem;
}

.main-header .dropdown-header small {
    opacity: 0.9;
}

.main-header .dropdown-item {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.main-header .dropdown-item:hover {
    background: var(--hover-bg);
    color: #667eea;
    transform: translateX(4px);
}

.main-header .dropdown-item i {
    width: 20px;
}

/* Admin Link Special Styling */
.main-header .dropdown-item.text-warning {
    background: rgba(255, 193, 7, 0.1);
}

.main-header .dropdown-item.text-warning:hover {
    background: rgba(255, 193, 7, 0.2);
}

/* Notification Dropdown */
.notification-dropdown {
    min-width: 360px;
    max-width: 400px;
    max-height: 500px;
}

.notification-header {
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s ease;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--hover-bg);
}

.notification-item.unread {
    background: rgba(102, 126, 234, 0.05);
    border-left: 3px solid #667eea;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.notification-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notification-footer {
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Navbar Right Side */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .main-header .navbar-nav {
        padding: 1rem 0;
    }
    
    .main-header .nav-link {
        margin: 0.25rem 0;
    }
    
    .main-header .search-container {
        max-width: 100%;
        margin: 1rem 0;
    }
    
    .main-header .navbar-right {
        width: 100%;
        justify-content: space-between;
        padding: 1rem 0;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .notification-dropdown {
        min-width: 320px;
    }
}

@media (max-width: 576px) {
    .main-header .logo-text {
        font-size: 1rem;
    }
    
    .main-header .nav-link span {
        display: inline;
    }
    
    .main-header .action-icon {
        width: 36px;
        height: 36px;
    }
    
    .notification-dropdown {
        min-width: 280px;
    }
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

.main-header a,
.main-header button {
    outline: none;
}

/* Auth Buttons */
.main-header .auth-btns {
    display: flex;
    align-items: center;
}

.main-header .auth-btns .btn {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.main-header .auth-btns .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.main-header .auth-btns .btn i {
    font-size: 1rem;
}

/* Accessibility */
.main-header .nav-link:focus,
.main-header .action-icon:focus,
.main-header .user-btn:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

