/* =========================================================
   Ẩm Thực - diện mạo riêng (cam đất/hổ phách, gợi màu gia vị/món ăn),
   phân biệt với Truyện (be/tan), Thơ (hồng), Nhạc (xanh da trời),
   Phim (xanh lá/mint), Ảnh (lavender nhạt).
   Chỉ load trong Areas/AmThuc/Views/Shared/_AmThuclayout.cshtml.
   Nền chính (.nenamthuc / .nenamthuctrai / .nentieude2) đã có sẵn trong
   base.css (nenamthucchinh.jpg, amthuctrai.png, nenamthuc.png - xác nhận
   có sẵn wwwroot/images), file này chỉ bổ sung phần base.css/danhsach.css
   chưa có: thanh sắp xếp, bảng mẫu tự, thẻ món ăn dạng danh sách (giống
   mẫu .tho-item/.phim-item, không phải lưới ảnh như Anh), dropdown facet,
   khối chấm điểm/thống kê trang chi tiết, bảng đối chiếu đo lường tĩnh.
   ========================================================= */

/* ---- Thanh chuyển đổi cách sắp xếp (Mới đăng / Xem nhiều / Đánh giá / Ngẫu nhiên) ---- */
.amthuc-sort-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 4px 0 22px;
}

.amthuc-sort-tab {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    background-color: #fde9d6;
    color: #a3521b !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 14px;
    border: 1px solid #f0c090;
    box-shadow: 0 1px 3px rgba(163, 82, 27, 0.15);
    transition: all .2s ease;
}

.amthuc-sort-tab:hover {
    background-color: #f8d4a8;
    transform: translateY(-1px);
}

.amthuc-sort-tab.active {
    background-color: #c1650f;
    color: #fff !important;
    border-color: #c1650f;
}

@media (max-width: 600px) {
    .amthuc-sort-tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        margin: 4px -4px 18px;
    }

    .amthuc-sort-tabs::-webkit-scrollbar {
        display: none;
    }

    .amthuc-sort-tab {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
}

/* ---- Bảng mẫu tự / tên tác giả (thay cho mautu1.ascx / tacgia1.ascx) ---- */
.box-chucai {
    padding: 14px;
    margin-bottom: 12px;
}

.box-title {
    font-size: 15px;
    font-weight: bold;
    color: #8a4a12;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.bang-chu-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.bang-chu-container .chu-box {
    min-width: 28px;
    text-align: center;
}

.nenamthuctrai .sidebar-title {
    color: #8a4a12;
    border-bottom-color: #f0c090;
}

/* ---- Dropdown facet (Món / Cách chế biến / Nguyên liệu) o sidebar ---- */
.amthuc-facet-select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #f0c090 !important;
    background-color: #fff !important;
    color: #8a4a12 !important;
    box-shadow: none !important;
    margin-top: 4px;
}

/* ---- Hộp gợi ý tìm kiếm nhanh ---- */
#amthuc-search-box {
    position: relative;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fffaf3;
    border: 1px solid #e6c9a0;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    margin-top: 4px;
    max-height: 320px;
    overflow-y: auto;
}

.suggestions-box .suggestion-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.suggestions-box .suggestion-list li {
    padding: 8px 14px;
    border-bottom: 1px solid #f3e2ca;
}

.suggestions-box .suggestion-list li:last-child {
    border-bottom: none;
}

.suggestions-box .suggestion-list a {
    color: #a3521b;
    font-weight: bold;
    text-decoration: none;
}

.suggestions-box .suggestion-list a:hover {
    text-decoration: underline;
}

.suggestions-box .text-muted {
    color: #888;
    font-size: 12px;
}

/* ---- Thẻ món ăn trong danh sách chính (mới đăng/xem nhiều/mẫu tự/tìm kiếm/tác phẩm) ----
   Ap dung tu dau mau list-item ellipsis-truncation (flex-wrap:nowrap, min-width:0,
   text-overflow:ellipsis) - xem playbook §5b, khong de lai fix phan ung nhu cac
   section truoc. */
.amthuc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.amthuc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 14px 20px;
    margin-bottom: 14px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(163, 82, 27, 0.12);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.amthuc-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(163, 82, 27, 0.18);
}

.amthuc-item-thumb {
    flex: 0 0 auto;
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(163, 82, 27, 0.25);
    box-shadow: 0 1px 4px rgba(163, 82, 27, 0.2);
}

.amthuc-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.amthuc-item-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

.amthuc-item-stars img {
    height: 16px;
    display: block;
}

.amthuc-item-title {
    font-size: 18px;
    font-weight: bold;
    color: #8a4a12 !important;
    text-decoration: none !important;
    line-height: 1.5;
    width: 100%;
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amthuc-item-title:hover {
    color: #c1650f !important;
}

.amthuc-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
    max-width: 42%;
    text-align: right;
}

.amthuc-item-tacgia,
.amthuc-item-mien {
    font-size: 14px;
    font-weight: normal;
    color: #a3521b !important;
    text-decoration: none !important;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amthuc-item-tacgia:hover,
.amthuc-item-mien:hover {
    text-decoration: underline !important;
}

.amthuc-item-views {
    display: inline-block;
    font-size: 13px;
    color: #555;
    background: #fff;
    border: 1px solid #e6c9a0;
    border-radius: 12px;
    padding: 3px 12px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .amthuc-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .amthuc-item-side {
        align-items: flex-start;
        max-width: 100%;
        text-align: left;
    }
}

/* ---- Nút tham khảo (Đơn vị đo lường / Từ điển nguyên liệu) trong sidebar ---- */
.amthuc-refbtn-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.amthuc-refbtn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fde9d6, #f8d4a8);
    border: 1px solid #f0c090;
    border-radius: 10px;
    color: #8a4a12 !important;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(163, 82, 27, 0.15);
    transition: all .2s ease;
}

.amthuc-refbtn:hover {
    background: linear-gradient(135deg, #f8d4a8, #f0c090);
    color: #c1650f !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(163, 82, 27, 0.25);
}

.amthuc-refbtn-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.amthuc-refbtn-label {
    flex: 1 1 auto;
}

/* ---- Trang chi tiết món ăn: thống kê + chấm điểm ---- */
.amthuc-stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    margin: 10px 0 20px;
    color: #555;
}

.amthuc-stats-info span {
    margin: 0 5px;
    font-weight: bold;
}

.amthuc-rating-block {
    cursor: pointer;
}

.amthuc-rating-stars {
    font-size: 30px;
    letter-spacing: 4px;
    line-height: 1;
}

.amthuc-star {
    font-style: normal;
    color: #ddd;
    cursor: pointer;
    transition: color 0.12s ease, transform 0.12s ease;
    display: inline-block;
}

.amthuc-star:hover {
    transform: scale(1.12);
}

.amthuc-star.filled {
    color: #e8940c;
    text-shadow: 0 0 6px rgba(232, 148, 12, 0.4);
}

.amthuc-rating-msg {
    font-size: 12px;
    color: #4caf50;
    margin-top: 4px;
    font-weight: bold;
}

.amthuc-rating-err {
    font-size: 12px;
    color: #c0392b;
    margin-top: 4px;
    font-weight: bold;
}

/* ---- Khối "Về tác giả" trên trang chi tiết ---- */
.amthuc-tacgia-box {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0c090;
}

.amthuc-tacgia-box h3 {
    color: #8a4a12;
    margin-bottom: 10px;
}

/* ---- Danh sách tác giả theo mẫu tự ---- */
.tacgia {
    color: #a3521b;
    font-size: 13px;
    margin-right: 10px;
}

/* ---- Bảng đối chiếu đo lường / từ điển nguyên liệu (trang tĩnh) ---- */
.amthuc-doluong-box {
    margin: 10px 0 20px;
}

.amthuc-doluong-box h3 {
    color: #8a4a12;
    margin: 22px 0 10px;
}

.amthuc-doluong-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 10px;
    background: rgba(255, 255, 255, 0.55);
}

.amthuc-doluong-table-wide {
    max-width: 700px;
}

.amthuc-doluong-table th,
.amthuc-doluong-table td {
    border: 1px solid #e6c9a0;
    padding: 6px 10px;
    text-align: center;
    font-size: 14px;
}

.amthuc-doluong-table th {
    background: #fde9d6;
    color: #8a4a12;
}

.amthuc-doluong-nguon {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-top: 16px;
}
