* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f1f5f9;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: #2563eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon::after {
    content: '';
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-btn:hover {
    background: #f3f4f6;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    background: #fb923c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Controls Section */
.controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 250px;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.add-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.add-btn:hover {
    background: #1d4ed8;
}

/* Tabs */
.tabs {
    margin-bottom: 1.5rem;
}

.tab-list {
    display: flex;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 4px;
    width: fit-content;
}

.tab-button {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tab-button:not(.active) {
    color: #6b7280;
}

/* Task Grid */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Task Cards */
.task-card {
    border-radius: 12px;
    border: 2px solid;
    padding: 1rem;
    background: white;
    transition: box-shadow 0.2s;
    position: relative;
}

.task-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.task-card.blue {
    background: #dbeafe;
    border-color: #bfdbfe;
}

.task-card.purple {
    background: #e9d5ff;
    border-color: #d8b4fe;
}

.task-card.yellow {
    background: #fef3c7;
    border-color: #fde68a;
}

.task-card.pink {
    background: #fce7f3;
    border-color: #f9a8d4;
}

.task-card.green {
    background: #d1fae5;
    border-color: #a7f3d0;
}

.task-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.task-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.task-menu {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
    position: relative;
}

.task-menu:hover {
    background: rgba(0, 0, 0, 0.05);
}

.task-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.task-time {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

/* Completed Task Styles */
.task-card.completed {
    opacity: 0.7;
    position: relative;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: #6b7280;
}

.task-card.completed .task-description {
    color: #9ca3af;
}

.task-card.completed .task-time {
    color: #9ca3af;
}

.task-card.completed::after {
    content: 'Completed';
    position: absolute;
    top: 0.75rem;
    right: 2.5rem;
    background: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #bbf7d0;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 10;
    overflow: hidden;
    display: none;
}

.task-menu:focus .dropdown-menu,
.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item.delete {
    color: #dc2626;
}

.dropdown-item.complete {
    color: #16a34a;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden; /* Giữ nguyên để modal bo góc */
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    /* Đã sửa đổi padding: Tăng padding-right thêm nữa */
    padding: 1.5rem; /* Tăng padding phải lên 2.5rem */
    /* Cú pháp padding: padding-top padding-right padding-bottom padding-left; */
    overflow-y: auto;
    flex-grow: 1;
}

/* Phần footer (nếu có), để đảm bảo nó vẫn nằm ngoài phần cuộn */
.modal-footer {
    padding: 1rem 1.5rem 1.5rem; /* Điều chỉnh padding cho footer */
    border-top: 1px solid #e5e7eb; /* Nếu muốn có đường kẻ ngăn cách */
    display: flex;
    justify-content: flex-end; /* Căn phải các nút */
    gap: 0.75rem; /* Khoảng cách giữa các nút */
}


/* Tùy chỉnh thanh cuộn cho trình duyệt WebKit (Chrome, Safari, Edge) */
.modal-body::-webkit-scrollbar {
    width: 12px; /* Tăng độ rộng của thanh cuộn để dễ thêm margin */
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
    /* Dòng này ĐƯỢC THÊM VÀO: Tạo margin từ biên phải cho thanh trượt */
    margin-right: 4px; /* Khoảng cách từ biên phải của rãnh scrollbar */
    border: 3px solid transparent; /* Tạo viền trong suốt để "ăn" vào margin-right */
    background-clip: padding-box; /* Đảm bảo background chỉ nằm trong phần padding của thumb */
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Tùy chỉnh thanh cuộn cho Firefox */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #888 transparent;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.form-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    transition: border-color 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* Font Awesome Icons */
.fa-icon {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .task-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 95%;
        margin: 1rem;
    }

    .time-inputs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-title {
        order: 3;
        width: 100%;
        text-align: center;
    }
}

/* ======= Toast message ======== */

#toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 2;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  /* background-color: rgba(255, 255, 255, 0.5); */
  border-radius: 2px;
  padding: 20px 0;
  min-width: 400px;
  max-width: 450px;
  border-left: 4px solid;
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  transition: all linear 0.3s;
  overflow: hidden;
  backdrop-filter: blur(15px);
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(calc(100% + 32px));
  }
  to {
    opacity: 1;
    transform: translateX(0);
}
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(150%);
    }
}

.toast--success {
  border-color: #47d864;
}
.toast--success::before,
.toast--info::before,
.toast--warning::before,
.toast--error::before
{
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    width: 100%;
    border-radius:4px;
}
.toast--success::before{
    background: #47d864;
}
.toast--info::before{
    background: #2f86eb;
}
.toast--warning::before{
    background: #ffc021;
}
.toast--error::before{
    background: #ff623d;
}
.toast--success.active::before,
.toast--info.active::before,
.toast--warning.active::before,
.toast--error.active::before
{
    animation: toast 5s linear forwards;
}

@keyframes toast {
  100%{
    right: 100%;
  }
}
.toast--success .toast__icon {
  color: #47d864;
}

.toast--info {
  border-color: #2f86eb;
}


.toast--info .toast__icon {
  color: #2f86eb;
}

.toast--warning {
  border-color: #ffc021;
}

.toast--warning .toast__icon {
  color: #ffc021;
}

.toast--error {
  border-color: #ff623d;
}

.toast--error .toast__icon {
  color: #ff623d;
}

.toast + .toast {
  margin-top: 24px;
}

.toast__icon {
  font-size: 24px;
}

.toast__icon,
.toast__close {
  padding: 0 16px;
}

.toast__body {
  flex-grow: 1;
}

.toast__title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.toast__msg {
  font-size: 14px;
  color: #888;
  margin-top: 6px;
  line-height: 1.5;
}

.toast__close {
  font-size: 20px;
  color: rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* Nền mờ bao phủ toàn màn hình */
.modal-delete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4); /* nền mờ */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}

/* Khi modal mở */
.modal-delete.show {
    visibility: visible;
    opacity: 1;
}

/* Hộp container chính */
.modal-delete .container {
    background-color: #fff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.3s ease;
}

/* Tiêu đề thông báo */
.modal-delete .title {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

/* Khu vực chứa các nút */
.modal-delete .btn {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* Nút Cancel */
.modal-delete .btn-canncel {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    background-color: #ccc;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.modal-delete .btn-canncel:hover {
    background-color: #b3b3b3;
}

/* Nút Yes */
.modal-delete .btn-yes {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    background-color: #ef4444;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.modal-delate .btn-yes:hover {
    background-color: #dc2626;
}

/* Hiệu ứng scale khi hiện modal */
@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}