/* Reset CSS cơ bản */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    /* --- PHẦN MỚI THÊM: Thiết lập để hỗ trợ lớp nền ảo --- */
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-color: #fffbeb; /* Màu dự phòng nếu ảnh không tải được */
}

/* --- PHẦN MỚI THÊM: Tạo lớp nền mờ (Background Blur) --- */
body::before {
    content: "";
    position: fixed; /* Giữ ảnh cố định khi cuộn trang */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1; /* Đẩy xuống sau cùng */

    /* Đường dẫn ảnh bánh chuối - Hãy thay tên file thật của bạn vào đây */
 background-image: url('../images/anhchuoibackground.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Làm mờ 15px và giảm độ sáng một chút để làm nổi nội dung */
    filter: blur(0.5px) brightness(0.5);
    
    /* Phóng to 1.1 lần để triệt tiêu các vết trắng ở mép màn hình do hiệu ứng blur */
    transform: scale(1.0);
}

/* Header sặc sỡ */
#main-header {
    background: linear-gradient(90deg, #ffcc00, #ff8c00, #d32f2f);
    color: white;
    text-align: center;
    padding: 2rem 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative; /* Đảm bảo nổi lên trên lớp nền */
}

.shop-title {
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Bố cục Container */
#container {
    display: flex;
    min-height: 80vh;
    position: relative;
}

/* Sidebar */
#sidebar {
    width: 250px;
    background-color: rgba(51, 51, 51, 0.9); /* Thêm độ trong suốt một chút */
    color: white;
    padding-top: 20px;
}

.nav-list {
    list-style: none;
}

.nav-item {
    padding: 15px 25px;
    border-bottom: 1px solid #444;
    transition: 0.3s;
}

.nav-item a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.nav-item:hover, .nav-item.active {
    background-color: #ffcc00;
}

.nav-item:hover a, .nav-item.active a {
    color: #000;
}

/* Nội dung chính */
#main-content {
    flex: 1;
    padding: 30px;
    /* --- PHẦN MỚI THÊM: Lớp nền kính mờ (Glassmorphism) --- */
    background-color: rgba(255, 255, 255, 0.6); /* Nền trắng trong suốt */
    backdrop-filter: blur(5px); /* Hiệu ứng kính mờ cho phần nội dung */
}

/* Các thẻ thống kê */
.stat-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-yellow { background: rgba(251, 192, 45, 0.9); }
.card-orange { background: rgba(245, 124, 0, 0.9); }
.card-red { background: rgba(211, 47, 47, 0.9); }

.number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

/* Bảng đơn hàng */
#order-section {
    background: rgba(255, 255, 255, 0.9); /* Làm bảng trắng rõ hơn */
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.section-title {
    margin-bottom: 20px;
    color: #d32f2f;
    border-left: 5px solid #ffcc00;
    padding-left: 10px;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
}

.order-table th, .order-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.order-table th {
    background-color: #fff9c4;
    color: #d32f2f;
}

/* --- CSS HÌNH ẢNH SẢN PHẨM --- */
.product-thumb {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid #ffcc00;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.product-thumb:hover {
    transform: scale(1.1);
}

/* Trạng thái */
.status {
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.done { background: #c8e6c9; color: #2e7d32; }
.pending { background: #ffecb3; color: #ff8f00; }

/* Footer */
#footer {
    text-align: center;
    padding: 30px;
    background: #ffcc00;
    color: #121311;
    font-size: 1rem;
    position: relative;
    font-weight: bold;
}
/* Thiết lập cho từng mục thông báo */
.notif-item {
    font-size: 0.9rem;
    color: #f5efef;
    padding: 25px 0;
    position: absolute;
    width: 100%;
    opacity: 0;
    /* Tổng thời gian 40 giây cho vòng lặp 20 người */
    animation: slide-up-fade 40s infinite; 
}

/* Cài đặt thời gian chờ (delay) cho từng người một */
.notif-item:nth-child(1) { animation-delay: 0s; }
.notif-item:nth-child(2) { animation-delay: 2s; }
.notif-item:nth-child(3) { animation-delay: 4s; }
.notif-item:nth-child(4) { animation-delay: 6s; }
.notif-item:nth-child(5) { animation-delay: 8s; }
.notif-item:nth-child(6) { animation-delay: 10s; }
.notif-item:nth-child(7) { animation-delay: 12s; }
.notif-item:nth-child(8) { animation-delay: 14s; }
.notif-item:nth-child(9) { animation-delay: 16s; }
.notif-item:nth-child(10) { animation-delay: 18s; }
.notif-item:nth-child(11) { animation-delay: 20s; }
.notif-item:nth-child(12) { animation-delay: 22s; }
.notif-item:nth-child(13) { animation-delay: 24s; }
.notif-item:nth-child(14) { animation-delay: 26s; }
.notif-item:nth-child(15) { animation-delay: 28s; }
.notif-item:nth-child(16) { animation-delay: 30s; }
.notif-item:nth-child(17) { animation-delay: 32s; }
.notif-item:nth-child(18) { animation-delay: 34s; }
.notif-item:nth-child(19) { animation-delay: 36s; }
.notif-item:nth-child(20) { animation-delay: 38s; }

/* Hiệu ứng trượt lên và hiện rõ */
@keyframes slide-up-fade {
    0% { transform: translateY(20px); opacity: 0; }
    2% { transform: translateY(0); opacity: 1; }
    4% { transform: translateY(0); opacity: 1; }
    6% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(-20px); opacity: 0; }
}

/* Trang trí cho cột Tổng tiền */
.total-price {
    font-weight: bold;
    color: #d32f2f; /* Màu đỏ đậm cho tiền */
    font-size: 1.1rem;
    text-align: right; /* Căn lề phải cho chuyên nghiệp */
}

/* Hiệu ứng nhấp nháy nhẹ cho trạng thái "Hết hàng" để cảnh báo */
.status.done[style*="Hết hàng"] {
    background: #ff5252;
    color: white;
    animation: flash 1s infinite;
}

@keyframes flash {
    50% { opacity: 0.7; }
}
/* --- PHẦN MỚI: TỐI ƯU CHO ĐIỆN THOẠI (RESPONSIVE) --- */

@media (max-width: 768px) {
    /* 1. Chuyển bố cục từ ngang sang dọc */
    #container {
        flex-direction: column;
    }

    /* 2. Sidebar rộng toàn màn hình và nằm trên hoặc dưới nội dung */
    #sidebar {
        width: 100%;
        padding: 10px;
    }

    .nav-list {
        display: flex; /* Cho menu nằm ngang trên điện thoại */
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .nav-item {
        border-bottom: none;
        padding: 10px;
        font-size: 0.9rem;
    }

    /* 3. Header thu nhỏ chữ lại cho vừa màn hình */
    .shop-title {
        font-size: 1.5rem;
    }

    #main-header {
        padding: 1rem 0;
    }

    /* 4. Các thẻ thống kê (Cards) xếp thành 1 cột */
    .stat-container {
        grid-template-columns: 1fr;
    }

    /* 5. Quan trọng nhất: Làm cho bảng có thể kéo ngang (Scroll) */
    #order-section {
        overflow-x: auto; /* Tạo thanh cuộn ngang nếu bảng quá rộng */
        padding: 10px;
    }

    .order-table {
        min-width: 600px; /* Đảm bảo bảng không bị bóp méo quá mức */
    }

    /* 6. Khu vực thông báo nhấp nháy */
    #live-notifications {
        border-top: 1px solid #ffcc00;
        margin-top: 10px;
    }

    /* 7. Footer thu nhỏ chữ */
    #footer p {
        font-size: 0.8rem;
    }
}