/* Top Navigation Styles - Material Design */
.top-navigation {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12), 0 1px 6px rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
    border-bottom: 1px solid #e0e0e0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Brand/Logo Section */
.nav-brand {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #1565c0;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.brand-link:hover {
    color: #0d47a1;
    background-color: rgba(21, 101, 192, 0.04);
    transform: translateY(-1px);
}

.brand-link i {
    font-size: 1.6rem;
    color: #ff6b35;
}

.brand-text {
    white-space: nowrap;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #424242;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    color: #424242;
    text-decoration: none;
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    letter-spacing: 0.25px;
}

.nav-link:hover {
    background: rgba(21, 101, 192, 0.08);
    color: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.15);
}

.nav-link i {
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
    color: #1565c0 !important;
}

.nav-badge {
    background: #f44336;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 22px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(244, 67, 54, 0.4);
}

/* User Profile Section */
.nav-user {
    flex-shrink: 0;
    position: relative;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e0e0e0;
    position: relative;
}

.user-dropdown:hover {
    background: #eeeeee;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.user-dropdown.show {
    background: #e3f2fd;
    border-color: #1565c0;
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    margin-top: 0.5rem;
}

.user-avatar {
    position: relative;
    flex-shrink: 0;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.user-dropdown:hover .user-avatar img {
    border-color: #1565c0;
}

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.status-indicator.online {
    background-color: #10b981;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name {
    color: #424242;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
}

.user-role {
    color: #757575;
    font-size: 0.8rem;
    font-weight: 400;
}

.user-dropdown-arrow {
    color: #757575;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.user-dropdown.show .user-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menus */
.dropdown-menu {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 16px rgba(0,0,0,0.08);
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    min-width: 220px;
    border: 1px solid #e0e0e0;
    position: absolute;
    z-index: 1050;
    display: none;
}

.dropdown-menu.show {
    display: block !important;
}

.nav-user {
    position: relative;
}

.dropdown-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
}

.dropdown-item {
    padding: 0.875rem 1.25rem;
    color: #424242;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 400;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
}

.dropdown-item:hover {
    background: #f5f5f5;
    color: #1565c0;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: #757575;
    font-size: 1rem;
}

.dropdown-item:hover i {
    color: #1565c0;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: #e0e0e0;
    opacity: 1;
}

.dropdown-item-text {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.text-success {
    color: #4caf50 !important;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        margin: 0;
        max-width: none;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.12);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: 1px solid #e0e0e0;
        border-top: none;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        align-items: stretch;
        justify-content: flex-start;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        border-radius: 0;
        justify-content: flex-start;
        color: #424242;
    }
    
    .nav-link i {
        color: #1565c0 !important;
    }
    
    .nav-link:hover {
        background: rgba(21, 101, 192, 0.08);
        transform: none;
        color: #1565c0;
    }
    
    .nav-link:hover i {
        color: #1565c0 !important;
    }
    
    .nav-link.active {
        background: #1565c0 !important;
        color: white !important;
    }
    
    .nav-link.active i {
        color: white !important;
    }
    
    .brand-text {
        display: none;
    }
    
    .user-info {
        display: none;
    }
    
    .user-dropdown {
        padding: 0.5rem;
        background: #f5f5f5;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .nav-link span {
        font-size: 0.85rem;
    }
    
    .user-name {
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .top-navigation {
        height: 60px;
    }
    
    .nav-container {
        padding: 0 0.5rem;
    }
    
    .brand-link {
        font-size: 1rem;
    }
    
    .brand-link i {
        font-size: 1.25rem;
    }
}

/* Body adjustments for fixed header */
body {
    padding-top: 70px;
}

@media (max-width: 480px) {
    body {
        padding-top: 60px;
    }
}

/* Page content adjustments */
.main-wrapper {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.page-wrapper {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.content {
    padding: 2rem 1rem;
    margin-left: 0 !important;
}

@media (max-width: 768px) {
    .content {
        padding: 1.5rem 0.75rem;
    }
}

/* Hide the old sidebar toggle */
#toggle_btn, #mobile_btn {
    display: none !important;
}

/* Hide the old header */
.header {
    display: none !important;
}

/* Active Navigation State - FORCED VISIBILITY */
.nav-link.active {
    background: #1565c0 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.5) !important;
    font-weight: 700 !important;
    border: 2px solid #0d47a1 !important;
    transform: translateY(-1px) !important;
}

.nav-link.active i {
    color: white !important;
}

.nav-link.active .nav-badge {
    background: #ff5722 !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(255, 87, 34, 0.5) !important;
    border: 1px solid white !important;
}

/* Material Design Improvements */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.nav-container {
    font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* Improved Focus States */
.nav-link:focus,
.user-dropdown:focus,
.brand-link:focus {
    outline: 2px solid #1565c0;
    outline-offset: 2px;
}

/* Enhanced Shadows */
.top-navigation {
    box-shadow: 
        0 2px 4px rgba(0,0,0,0.08),
        0 1px 6px rgba(0,0,0,0.04),
        0 1px 2px rgba(0,0,0,0.12);
}

/* Typography Enhancement */
.nav-link,
.dropdown-item,
.user-name,
.brand-text {
    font-family: 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improved Contrast */
.nav-link {
    color: #424242;
    font-weight: 500;
}

.nav-link:hover i {
    color: #1565c0 !important;
}

/* Material Design Elevation */
.nav-menu.active {
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.12),
        0 4px 6px rgba(0,0,0,0.08),
        0 2px 4px rgba(0,0,0,0.06);
}

.dropdown-menu {
    box-shadow:
        0 8px 32px rgba(0,0,0,0.12),
        0 4px 16px rgba(0,0,0,0.08),
        0 2px 8px rgba(0,0,0,0.04);
}

/* Ripple Animation */
@keyframes ripple-animation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Material Design Text Styles */
.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.25px;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.25px;
}

/* Improved Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .nav-link {
        border: 1px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link.active {
        border-color: #1565c0;
    }
    
    .user-dropdown {
        border: 2px solid #424242;
    }
}

/* SUPER FORCE ACTIVE STATE - HIGHEST PRIORITY */
.nav-link.active,
.nav-link.active:hover,
.nav-link.active:focus,
.nav-link.active:visited {
    background-color: #1565c0 !important;
    background: #1565c0 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border: 2px solid #0d47a1 !important;
    border-radius: 24px !important;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.5) !important;
    transform: translateY(-1px) !important;
}

.nav-link.active i,
.nav-link.active:hover i,
.nav-link.active:focus i {
    color: #ffffff !important;
}

.nav-link.active .nav-badge,
.nav-link.active:hover .nav-badge {
    background-color: #ff5722 !important;
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
}

/* Mobile active state */
@media (max-width: 991px) {
    .nav-link.active {
        background: #1565c0 !important;
        color: white !important;
        font-weight: 700 !important;
        border-left: 4px solid #0d47a1 !important;
    }
    
    .nav-link.active i {
        color: white !important;
    }
}
