/* ✅ Căn chỉnh dropdown để không bị tràn */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 200px; /* Giới hạn chiều rộng */
    max-width: 90vw; /* Giới hạn không vượt quá màn hình */
    background-color: white;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

/* ✅ Fix profile avatar bị lệch trên mobile */
.profile-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 5px;
}

/* ✅ Header căn chỉnh đúng */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100vw;
    padding: 10px;
    box-sizing: border-box;
}

/* ✅ Đảm bảo dropdown không bị tràn trên mobile */
@media (max-width: 768px) {
    .dropdown-menu {
        width: 90vw;
        left: 50%;
        transform: translateX(-50%);
    }

    .profile-menu {
        width: auto;
        max-width: 50px;
        height: auto;
    }

    .header {
        flex-wrap: wrap;
        padding: 8px;
    }
}

/*Profile*/
.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}
.body-profile {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.container-profile{
    max-width: 1000px; /* Độ rộng tối đa */
    margin: auto; /* Căn giữa */
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.menu {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: white;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    margin: 20px auto; /* Căn giữa */
    max-width: 1000px; /* Độ rộng menu giống với container */
}
.menu a {
    text-decoration: none;
    color: #121213;
    font-weight: bold;
    font-size: 14px;
}
.menu a:hover {
    color: #007BFF;
}
.global-nav {
background-color: #469cf3;
color: white;
padding: 10px 0;
text-align: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.global-nav a {
color: white;
text-decoration: none;
margin: 0 15px;
font-size: 16px;
font-weight: bold;
}
.global-nav a:hover {
text-decoration: underline;
}
main {
display: flex;
flex-wrap: wrap;
gap: 20px;
padding: 20px;
justify-content: center;
}

.sidebar {
background-color: #4CAF50;
color: white;
padding: 20px;
border-radius: 12px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
max-width: 300px;
width: 100%;
text-align: center;
}
.sidebar h2 {
margin-bottom: 20px;
}
.avatar-img {
width: 120px;
height: 120px;
border-radius: 50%;
object-fit: cover;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
margin-bottom: 15px;
}
/* Bảng làm việc */
.task-board {
    flex: 1; /* Giúp task-board mở rộng */
    background-color: #fff; /* Màu nền */
    padding: 20px;
    border-radius: 10px; /* Bo góc nhẹ */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Cho phép cuộn nếu nội dung quá dài */
}
.task-board h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #490eec;
    }
.task-board ul {
    list-style: none;
    padding: 0;
    margin: 0;
    }
.task-board li {
    padding: 10px;
    border-bottom: 1px solid #7b7df3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
    }
.task-board li:hover {
    background-color: #f9f9f9;
    }
.task-board li:last-child {
    border-bottom: none;
    }
.task-history-container {
    position: relative;
    z-index: 10;
    margin-top: 20px;
text-align: right;
}
.no-tasks {
    text-align: center;
    color: #999;
    font-size: 14px;
    }
.task-zone {
        background: #f8f9fa;
        padding: 20px;
        border-radius: 12px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        margin-bottom: 20px;
    }
.task-zone h2 {
        text-align: center;
        color: #007bff;
        margin-bottom: 15px;
        border-bottom: 2px solid #dee2e6;
        padding-bottom: 10px;
    }
.task {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 10px;
        background: rgb(47, 100, 245);
        border-left: 5px solid #ddd;
        font-weight: bold;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: grab;
        transition: 0.3s;
    }
.task:hover {
        background: #f1f1f1;
    }
.task.completed { 
    border-left-color: #28a745; 
}
.task.in-progress { 
    border-left-color: #ffc107; 
}
.task.not-completed { 
    border-left-color: #dc3545; 
}
/* Lịch sử */
.history-btn {
    display: inline-block;
background-color: #469cf3;
color: white;
padding: 10px 20px;
border-radius: 8px;
font-size: 16px;
text-decoration: none;
font-weight: bold;
transition: 0.3s;
}
.history-btn:hover {
background-color: #5a6268;
transform: scale(1.1);
}
/* Nút nhấn */
.btn {
background: linear-gradient(135deg, #6a11cb, #2575fc);
color: white;
border: none;
padding: 10px 20px;
border-radius: 8px;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
}
.btn:hover {
background: linear-gradient(135deg, #2575fc, #6a11cb);
transform: translateY(-2px);
box-shadow: 0 8px 15px rgba(106, 17, 203, 0.3);
}
.btn-primary {
background-color: #469cf3;
border: none;
border-radius: 10px;
padding: 10px 20px;
}
.btn-primary:hover {
background-color: #0056b3;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.btn-back { 
    background-color: #FFC107; 
}
.btn-back:hover { 
    background-color: #E0A800; 
}
.btn-create { 
    background-color: #28a745; 
}
.btn-create:hover { 
    background-color: #218838; 
}
.btn-completed { 
    background-color: #007BFF; 
}
.btn-completed:hover { 
    background-color: #0056b3; 
}

/* Màu xanh lá chớp khi hoàn thành */
.task-btn.completed {
background-color: #28a745;
color: white;
border: none;
padding: 8px 12px;
border-radius: 5px;
cursor: pointer;
animation: blink-green 1s infinite;
}
/* Màu vàng chớp sáng khi đang làm */
.task-btn.in-progress {
background-color: #ffc107;
color: black;
border: none;
padding: 8px 12px;
border-radius: 5px;
cursor: pointer;
animation: blink-yellow 1s infinite;
}
/* Màu đỏ chớp khi chưa bắt đầu */
.task-btn.not-completed {
background-color: #dc3545;
color: white;
border: none;
padding: 8px 12px;
border-radius: 5px;
cursor: pointer;
animation: blink-red 1s infinite;
}
/* Hiệu ứng nhấp nháy màu xanh */
@keyframes blink-green {
0%, 100% { background-color: #28a745; }
50% { background-color: #28a745; }
}
/* Hiệu ứng nhấp nháy màu vàng */
@keyframes blink-yellow {
0%, 100% { background-color: #ffc107; }
50% { background-color: #ffffff; }
}
/* Hiệu ứng nhấp nháy màu đỏ */
@keyframes blink-red {
0%, 100% { background-color: #dc3545; }
50% { background-color: #dc3545; }
}

.header a {
    text-decoration: none;
    color: rgb(218, 218, 221);
    font-weight: bold;
    font-size: 16px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: 0.3s;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #469cf3;
    color: white;
    text-align: center;
    padding: 15px 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.container-task-board {
    max-width: 1000px; 
    margin: auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}
.section-title {
text-align: center;
color: #020202;
margin-bottom: 15px;
border-bottom: 2px solid #dee2e6;
padding-bottom: 10px;
}
.employee-board {
margin-top: 40px;
}
.employee {
margin-bottom: 10px;
padding: 10px;
border-radius: 8px;
background: #f1f1f1;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
font-weight: bold;
}

/* 📌 Hộp chat luôn nằm trên cùng */
.chat-box {
    position: fixed;
    bottom: 20px; /* Khoảng cách từ dưới lên */
    right: 20px; /* Khoảng cách từ phải sang */
    width: 350px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 9999; /* Đảm bảo nằm trên tất cả */
}

/* 📌 Header của hộp chat */
.chat-header {
    background: #007bff;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

/* 📌 Danh sách tin nhắn */
.chat-messages {
    padding: 10px;
    height: 250px;
    overflow-y: auto;
    background: #fafafa;
}

/* 📌 Ô nhập tin nhắn */
.chat-input {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 10px;
    background: #fff;
}

.chat-input input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 14px;
}

.chat-input button {
    background-color: #28a745;
    border: none;
    color: white;
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    margin-left: 5px;
}

.chat-input button:hover {
    background-color: #218838;
}
