/* assets/css/header.css - Fixed Left Sidebar (POLISHED) */

:root {
    --primary-color: #ff6600; 
    --primary-hover: #e65c00;
    --primary-light: #fff0e6;
    --bg-body: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.95);
    --text-main: #181818;
    --text-muted: #777777;
    --border-color: #efefef;
    --icon-hover-bg: #f0f0f0;
}

html[data-theme="dark"] {
    --bg-body: #101010;
    --bg-header: rgba(16, 16, 16, 0.95);
    --text-main: #f3f5f7;
    --text-muted: #999999;
    --border-color: #333333;
    --icon-hover-bg: #1e1e1e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-left: 260px; /* 250px sidebar + 10px margin */
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- LEFT SIDEBAR (MESH HEADER) --- */
.mesh-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.header-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    padding: 0 15px;
}

/* 1. Logo */
.logo {
    display: flex;
    align-items: center;
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--primary-color);
    gap: 8px;
    padding: 10px 5px;
    margin-bottom: 25px;
    transition: transform 0.2s;
}

/* 2. Navigation */
.main-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-bottom: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    border-radius: 25px; 
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 1.3rem;
    color: var(--text-muted);
    width: 25px;
    text-align: center;
    transition: color 0.2s;
}

.nav-item:hover {
    background-color: var(--icon-hover-bg);
}

.nav-item:hover i, .nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    background-color: transparent;
    font-weight: 700; 
    color: var(--primary-color);
}

.nav-item.active i {
    color: var(--primary-color);
    font-weight: 900;
}

/* Avatar nhỏ trong Menu */
.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

/* 3. Actions */
.header-actions {
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.btn-logout, .btn-login, #theme-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 25px;
    transition: background 0.2s;
}

.btn-login {
    background-color: var(--primary-color);
    color: white;
    font-weight: 700;
}

/* --- Responsive cho Mobile --- */
@media (max-width: 768px) {
    .mesh-header {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 0;
        flex-direction: row;
        justify-content: center;
    }
    .header-container {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
    }
    body {
        padding-left: 0;
        padding-bottom: 60px; 
    }
    .logo, .header-actions {
        display: none;
    }
    .main-nav {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
    }
    .nav-item {
        gap: 0;
        padding: 10px;
        border-radius: 50%;
        font-size: 0;
    }
    .nav-item i {
        font-size: 1.5rem;
        width: auto;
    }
}

/* Badge đếm số lượng */
.nav-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff3b30; /* Màu đỏ nổi bật */
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 16px;
    min-width: 16px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-container); /* Viền trùng màu nền để tách khỏi icon */
    z-index: 10;
    box-sizing: border-box;
}

/* Chỉnh lại icon wrap để position relative hoạt động tốt */
.nav-item div {
    display: flex;
    align-items: center;
    justify-content: center;
}