﻿:root {
    --primary-color: #4e73df;
    --secondary-color: #f8f9fc;
    --text-color: #333;
    --border-color: #e3e6f0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
}

.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 0.5rem 0;
}

.logo {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    display: flex;
    align-items: center;
}

    .logo:hover {
        color: var(--primary-color);
    }

.logo-icon {
    background-color: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 8px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
}

.navbar-toggler {
    border: none;
    background: transparent;
    padding: 8px;
    color: var(--text-color);
}

    .navbar-toggler:focus {
        box-shadow: none;
    }

.navbar-nav .nav-item {
    margin: 0 2px;
}

.navbar-nav .nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 12px;
    position: relative;
}

    .navbar-nav .nav-link:hover {
        color: var(--primary-color);
    }

    .navbar-nav .nav-link.active {
        color: var(--primary-color);
    }

        .navbar-nav .nav-link.active:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 12px;
            right: 12px;
            height: 3px;
            background-color: var(--primary-color);
        }

    .navbar-nav .nav-link i {
        margin-right: 5px;
    }

/* Right side elements container */
.navbar-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* Search container */
.search-container {
    position: relative;
    width: 220px;
    margin-right: 10px;
}

    .search-container input {
        padding-right: 32px;
        border-radius: 20px;
        border: 1px solid var(--border-color);
    }

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #999;
    padding: 0;
}

/* Action buttons container */
.nav-actions {
    display: flex;
    align-items: center;
}

.action-icon {
    cursor: pointer;
    color: #6c757d;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 4px;
}

.dark-mode-toggle .fa-sun {
    display: none;
}

.notification-btn {
    color: #6c757d;
    text-decoration: none;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74a3b;
    color: white;
    font-size: 10px;
    height: 18px;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.user-dropdown {
    margin-left: 8px;
}

.user-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 8px 16px;
    font-weight: 500;
}

    .dropdown-item:hover {
        background-color: #f8f9fc;
    }

.dropdown-divider {
    margin: 0.5rem 0;
}

.notification-dropdown {
    width: 320px;
    padding: 0;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

    .notification-item:hover {
        background-color: rgba(78, 115, 223, 0.05);
    }

    .notification-item.unread {
        background-color: rgba(78, 115, 223, 0.1);
    }

.notification-title {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 14px;
}

.notification-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
}

.notification-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.auth-btns {
    display: flex;
    gap: 8px;
    margin-left: 8px;
}

    .auth-btns .btn i {
        margin-right: 5px;
    }

/* Responsive Adjustments - Improved */
@media (max-width: 1199px) {
    /* First level of responsive: hide text in nav items, keep icons */
    .navbar-nav .nav-link span {
        display: none;
    }

    .navbar-nav .nav-link i {
        margin-right: 0;
        font-size: 16px;
    }

    .navbar-nav .nav-link {
        padding: 8px 10px;
        text-align: center;
    }
}

@media (max-width: 991px) {
    /* Second level: hamburger menu */
    .navbar-nav {
        padding-top: 1rem;
    }

    .navbar-right {
        flex-wrap: nowrap;
        margin-top: 0.5rem;
        width: 100%;
    }

    .navbar-nav .nav-link {
        padding: 10px;
        text-align: left;
    }

        .navbar-nav .nav-link span {
            display: inline;
        }

        .navbar-nav .nav-link i {
            margin-right: 8px;
        }

        .navbar-nav .nav-link.active:after {
            display: none;
        }

    .navbar-nav .nav-item {
        margin: 0;
    }

    .navbar-nav .nav-link.active {
        background-color: rgba(78, 115, 223, 0.1);
        border-radius: 4px;
    }

    .search-container {
        flex-grow: 1;
        margin-right: 10px;
        max-width: 100%;
        width: auto;
    }
}

@media (max-width: 767px) {
    /* Third level: stack and reorganize */
    .navbar-right {
        flex-direction: row;
        justify-content: space-between;
    }

    .auth-btns .btn span {
        display: none;
    }

    .auth-btns .btn i {
        margin-right: 0;
    }

    .dropdown-menu {
        position: fixed !important;
        top: auto !important;
        right: 10px !important;
        left: auto !important;
        transform: none !important;
        width: auto;
        max-width: 320px;
    }
}

@media (max-width: 575px) {
    /* Fourth level: extreme condensing */
    .navbar-right {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .auth-btns .btn {
        padding: 0.25rem 0.5rem;
    }

    .nav-actions {
        margin-right: 5px;
    }

    .action-icon {
        width: 28px;
        height: 28px;
        margin: 0 2px;
    }

    .user-dropdown {
        margin-left: 2px;
    }

    .avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .auth-btns {
        margin-left: 2px;
        gap: 4px;
    }
}

/* Dark mode */
.dark-mode {
    --primary-color: #4e73df;
    --secondary-color: #2c3144;
    --text-color: #e3e6f0;
    --border-color: #4b5563;
    background-color: #1a202c;
}

    .dark-mode .main-header {
        background-color: #2d3748;
    }

    .dark-mode .logo {
        color: white;
    }

    .dark-mode .navbar-toggler {
        color: white;
    }

    .dark-mode .navbar-nav .nav-link {
        color: white;
    }

    .dark-mode .search-container input {
        background-color: #4a5568;
        border-color: #4a5568;
        color: white;
    }

    .dark-mode .search-btn {
        color: #e2e8f0;
    }

    .dark-mode .dark-mode-toggle .fa-moon {
        display: none;
    }

    .dark-mode .dark-mode-toggle .fa-sun {
        display: block;
        color: #f6e05e;
    }

    .dark-mode .action-icon {
        color: #e2e8f0;
    }

    .dark-mode .dropdown-menu {
        background-color: #2d3748;
        border-color: #4b5563;
    }

    .dark-mode .dropdown-item {
        color: #e2e8f0;
    }

        .dark-mode .dropdown-item:hover {
            background-color: #4a5568;
        }

    .dark-mode .dropdown-divider {
        border-color: #4b5563;
    }

    .dark-mode .notification-item {
        border-color: #4b5563;
    }

        .dark-mode .notification-item:hover {
            background-color: rgba(78, 115, 223, 0.15);
        }

        .dark-mode .notification-item.unread {
            background-color: rgba(78, 115, 223, 0.2);
        }

    .dark-mode .notification-info {
        color: #a0aec0;
    }

    .dark-mode .notification-footer {
        border-color: #4b5563;
    }

    .dark-mode .navbar-nav .nav-link.active {
        background-color: rgba(78, 115, 223, 0.2);
    }

