/*
 * AI Health Companion - Wizard Theme Styles
 * Version: 2.3 - BMI Chart Logic & Mobile Layout Fix
 */

/* --- Biến màu & Font chung --- */
:root {
    --ahc-primary-color: #00A99D; /* Xanh ngọc */
    --ahc-primary-hover: #00897b;
    --ahc-secondary-color: #000000; /* Đen bóng */
    --ahc-secondary-hover: #5a6268;
    --ahc-text-dark: #333333;
    --ahc-text-light: #666666;
    --ahc-border-color: #e0e0e0;
    --ahc-font-family: 'Poppins', sans-serif;
    
    /* === MỚI: Định nghĩa màu cho biểu đồ BMI chi tiết hơn === */
    --bmi-severe-underweight-color: #d32f2f; /* Đỏ đậm */
    --bmi-underweight-color: #f57c00;      /* Cam */
    --bmi-normal-color: #388e3c;           /* Xanh lá */
    --bmi-overweight-color: #fbc02d;       /* Vàng */
    --bmi-obese-1-color: #e64a19;          /* Cam đậm */
    --bmi-obese-2-color: #c2185b;          /* Hồng đậm */
}

/* --- Cấu trúc chung & Wizard --- */
#ahc-container.ahc-wizard-mode { 
    max-width: 950px; 
    margin: 20px auto; 
    font-family: var(--ahc-font-family); 
    background-color: #F4F7F6; 
    padding: 20px; 
    border-radius: 12px; 
    box-sizing: border-box; 
}
.ahc-wizard-container { position: relative; width: 100%; }
/* Lớp mới để điều khiển overflow */
.ahc-wizard-container.is-sliding { overflow: hidden; }
.ahc-wizard-steps { display: flex; width: 300%; transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1); }
.ahc-wizard-step { width: calc(100% / 3); padding: 0 10px; box-sizing: border-box; flex-shrink: 0; }

/* --- Thanh tiến trình (Progress Bar) --- */
.ahc-progress-bar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; position: relative; padding: 0 20px; }
.ahc-progress-bar::before { content: ''; position: absolute; top: 15px; left: 0; width: 100%; height: 4px; background-color: var(--ahc-border-color); z-index: 1; }
.ahc-progress-bar-fill { position: absolute; top: 15px; left: 0; width: 0%; height: 4px; background-color: var(--ahc-primary-color); z-index: 2; transition: width 0.5s ease; }
.ahc-progress-step { text-align: center; z-index: 3; position: relative; cursor: pointer; }
.ahc-progress-step span { display: flex; justify-content: center; align-items: center; width: 30px; height: 30px; border-radius: 50%; background-color: #fff; border: 3px solid var(--ahc-border-color); color: var(--ahc-text-light); font-weight: 700; transition: all 0.4s ease; }
.ahc-progress-step p { font-size: 13px; font-weight: 600; color: var(--ahc-text-light); margin-top: 8px; transition: color 0.4s ease; }
.ahc-progress-step.active span { border-color: var(--ahc-primary-color); background-color: var(--ahc-primary-color); color: #fff; }
.ahc-progress-step.active p { color: var(--ahc-primary-color); }

/* --- Card & Footer --- */
.ahc-card { background-color: #FFFFFF; border: 1px solid var(--ahc-border-color); border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }
.ahc-card-header { padding: 20px 25px; border-bottom: 1px solid var(--ahc-border-color); background-color: #fafafa; border-radius: 12px 12px 0 0;}
.ahc-card-header h2 { margin: 0 0 5px 0; color: var(--ahc-primary-color); font-size: 26px; font-weight: bold; }
.ahc-card-header p { margin: 0; color: var(--ahc-text-light); font-size: 14px; }
.ahc-card-body { padding: 25px; }
.ahc-card-footer { padding: 20px 25px; border-top: 1px solid var(--ahc-border-color); background-color: #fafafa; border-radius: 0 0 12px 12px; }

/* --- Buttons --- */
.ahc-button { display: block; width: 100%; padding: 14px 20px; background-color: var(--ahc-primary-color); color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 700; cursor: pointer; text-align: center; transition: background-color 0.3s, transform 0.2s; }
.ahc-button:hover { background-color: var(--ahc-primary-hover); transform: translateY(-2px); }
.ahc-button:disabled { background-color: #ccc; cursor: not-allowed; transform: none;}
.ahc-button.secondary { background-color: var(--ahc-secondary-color); }
.ahc-button.secondary:hover { background-color: var(--ahc-secondary-hover); }
/* === NÂNG CẤP BỐ CỤC CHO CÁC NÚT ĐIỀU HƯỚNG (v2) === */
.ahc-nav-buttons {
    display: flex;
    gap: 15px;
}

/* 
 * Áp dụng cho TẤT CẢ các phần tử con trực tiếp của .ahc-nav-buttons
 * (bao gồm cả button và div wrapper) để chúng chia đều không gian.
*/
.ahc-nav-buttons > * {
    flex: 1; /* Đây là cách viết tắt cho flex-grow: 1, flex-shrink: 1, flex-basis: 0% */
}

/* 
 * Loại bỏ quy tắc width: 50% cũ có thể đang tồn tại.
 * Chúng ta sẽ đặt width là 'auto' để nó tuân theo flexbox.
 * Dùng !important để đảm bảo nó thắng các quy tắc cũ khác.
*/
.ahc-nav-buttons .ahc-button {
    width: auto !important;
}

/* 
 * Riêng nút nằm bên trong wrapper thì phải chiếm 100% chiều rộng của wrapper đó.
*/
.ahc-primary-action-wrapper .ahc-button {
    width: 100% !important;
}

/* --- Kết quả ở Bước 3 --- */
.ahc-result-section { padding: 20px 0; border-bottom: 1px solid var(--ahc-border-color); text-align: justify;}
.ahc-result-section:last-child { border-bottom: none; padding-bottom: 0; }
.ahc-result-section h3 { margin-top: 0; margin-bottom: 15px; color: var(--ahc-primary-color); font-size: 20px; font-weight: 600; }

/* --- Form Elements --- */
.ahc-form-group { margin-bottom: 18px; position: relative;}
.ahc-form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--ahc-text-dark); font-size: 14px; }
.ahc-form-group-inline { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
/* === SỬA LỖI: Style cho Radio Group === */
.ahc-radio-group { display: flex; gap: 15px; }
.ahc-radio-group label { display: flex; align-items: center; gap: 5px; font-weight: normal; font-size: 15px; }
.ahc-form-group input, .ahc-form-group select { width: 100%; padding: 12px; border: 1px solid var(--ahc-border-color); border-radius: 8px; box-sizing: border-box; font-size: 16px; transition: border-color 0.3s, box-shadow 0.3s; }
.ahc-input-with-icon .ahc-input-icon { position: absolute; top: 50%; left: 15px; transform: translateY(20%); color: var(--ahc-text-light); font-size: 18px; pointer-events: none; z-index: 1;}
.ahc-input-with-icon input, .ahc-input-with-icon select { padding-left: 45px !important; }

/* === NÂNG CẤP: File Upload & Drag-and-Drop === */
.ahc-file-upload-label { display: block; border: 2px dashed var(--ahc-border-color); padding: 30px; text-align: center; border-radius: 8px; cursor: pointer; transition: all 0.3s; }
.ahc-file-upload-label:hover,
.ahc-file-upload-label.dragover { 
    border-color: var(--ahc-primary-color); 
    background-color: #f7fffe; 
    transform: scale(1.02);
}
.ahc-file-upload-label.dragover span { color: var(--ahc-primary-color); font-weight: 600; }
input[type="file"] { display: none; }

/* === NÂNG CẤP: Biểu đồ BMI mới & Kết quả === */
.ahc-bmi-chart-container { position: relative; max-width: 350px; margin: 0 auto 20px; text-align: center; }
#ahc-bmi-text-result { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; }
.bmi-value-wrapper { font-size: 20px; font-weight: 400; color: var(--ahc-text-dark); }
.bmi-value-wrapper span { font-size: 48px; font-weight: 700; line-height: 1; }
.bmi-category { font-size: 18px; font-weight: 600; margin-top: 5px; }

/* Lớp màu cho chữ dựa trên danh mục BMI */
.bmi-severe-underweight { color: var(--bmi-severe-underweight-color) !important; }
.bmi-underweight { color: var(--bmi-underweight-color) !important; }
.bmi-normal { color: var(--bmi-normal-color) !important; }
.bmi-overweight { color: var(--bmi-overweight-color) !important; }
.bmi-obese-1 { color: var(--bmi-obese-1-color) !important; }
.bmi-obese-2 { color: var(--bmi-obese-2-color) !important; }

/* --- Meal Analysis Results --- */
#ahc-analysis-details .total-calories-value { font-size: 42px; font-weight: 700; color: var(--ahc-primary-color); }
.ahc-meal-list { list-style: none; padding: 0; margin:0; }
.ahc-meal-item { display: flex; align-items: center; padding: 15px 0; border-bottom: 1px solid #f0f0f0; } 
.ahc-meal-item:last-child { border-bottom: none; }
.ahc-meal-icon { font-size: 24px; margin-right: 15px; } 
.ahc-meal-details { flex-grow: 1; font-weight: 500; }

/* --- Chú thích biểu đồ Calo --- */
.ahc-chart-legend { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 15px; }
.ahc-legend-item { display: flex; align-items: center; font-size: 13px; color: var(--ahc-text-light); }
.ahc-legend-color { width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; }

/* --- Style cho Gợi ý Thực đơn có Icon --- */
#ahc-suggestion-container h4 { margin-top: 25px; margin-bottom: 10px; font-size: 1.1em; }
#ahc-suggestion-container h4:first-child { margin-top: 5px; }
#ahc-suggestion-container ul { list-style: none; padding-left: 0; margin-top: 0; }
#ahc-suggestion-container li { display: flex; align-items: baseline; margin-bottom: 8px; line-height: 1.6;}
#ahc-suggestion-container li::before { content: attr(data-icon); margin-right: 10px; font-size: 18px; }
#ahc-suggestion-container p > em { display: block; margin-top: 8px; font-size: 0.9em; color: #555; border-left: 3px solid var(--ahc-primary-color); padding-left: 10px; font-style: normal; text-align: justify; }

/* --- Loader --- */
#ahc-loader { text-align: center; padding: 20px; }
.ahc-spinner { border: 4px solid #f3f3f3; border-top: 4px solid var(--ahc-primary-color); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* === NÂNG CẤP: Responsive cho Mobile === */
@media (max-width: 768px) {
    #ahc-container.ahc-wizard-mode { padding: 1px; }
    .ahc-card-header h2 { font-size: 22px; }
    .ahc-card-body, .ahc-card-footer, .ahc-card-header { padding: 15px; }
    .ahc-progress-bar p { display: none; }
    .ahc-progress-bar { padding: 0; }
    .ahc-nav-buttons { flex-direction: column; }
    .ahc-nav-buttons .ahc-button { width: 100%; }
    #ahc-bmi-text-result .bmi-value-wrapper span { font-size: 40px; }
    #ahc-bmi-text-result .bmi-category { font-size: 16px; }

    /* === SỬA LỖI: Xếp chồng các lựa chọn trên mobile === */
    .ahc-form-group-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .ahc-radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
}



/* === MỚI: Styles cho các tính năng nâng cao ở Bước 3 === */

/* Lời nhắc tải ảnh chi tiết hơn */
.ahc-upload-hint {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Thông báo/Lưu ý */
.ahc-notice {
    background-color: #eef7ff;
    border-left: 4px solid #5e72e4;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.ahc-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}
.ahc-notice strong {
    color: #5e72e4;
}

/* Danh sách món ăn có thể chỉnh sửa */
.ahc-meal-list-editable {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ahc-meal-item-editable {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.ahc-meal-item-editable:last-child {
    border-bottom: none;
}
.ahc-meal-name-input {
    flex-grow: 1;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 16px;
    font-family: var(--ahc-font-family);
    transition: all 0.3s ease;
}
.ahc-meal-name-input:focus {
    outline: none;
    border-color: var(--ahc-primary-color);
    background-color: #f7fffe;
    box-shadow: 0 0 0 2px rgba(0, 169, 157, 0.2);
}

/* Nút tính toán lại */
#ahc-recalculate-controls {
    margin-top: 20px;
    margin-bottom: 30px; /* Thêm khoảng trống ở dưới */
}
#ahc-recalculate-btn {
    background-color: var(--ahc-secondary-color);
}
#ahc-recalculate-btn:hover {
    background-color: var(--ahc-secondary-hover);
}

/* NÂNG CẤP: Disclaimer nổi bật hơn */
.ahc-disclaimer {
    font-size: 14px;
    color: #575757;
    text-align: left;
    padding: 15px 20px;
    background-color: #fffbe6; /* Màu vàng nhạt cảnh báo */
    border-radius: 8px;
    line-height: 1.7;
    border-left: 5px solid #f59e0b; /* Màu vàng đậm làm điểm nhấn */
    margin-top: 20px;
}
.ahc-disclaimer p {
    margin: 0;
    text-align: justify !important;
}
.ahc-disclaimer::before {
     content: '⚠️'; /* Thêm icon cảnh báo */
     margin-right: 10px;
     font-size: 1.2em;
     float: left;
}
.ahc-disclaimer strong {
    color: #b45309; /* Màu vàng sậm hơn cho chữ in đậm */
}

/* === NÂNG CẤP: Tối ưu hiển thị danh sách món ăn trên Mobile (bản sửa lỗi) === */
@media (max-width: 768px) {
    .ahc-meal-item-editable {
        flex-wrap: wrap;
        row-gap: 2px; /* Giảm khoảng cách dọc */
    }

    /* Tên món ăn (ô input) sẽ chiếm không gian còn lại bên cạnh icon */
    .ahc-meal-item-editable .ahc-meal-name-input {
        flex-grow: 1;
        flex-basis: auto; /* Reset lại thuộc tính cũ */
    }

    /* Lượng calo sẽ chiếm 100% chiều rộng của dòng tiếp theo */
    .ahc-meal-item-editable .ahc-meal-calories {
        flex-basis: 100%;
        text-align: right;
        padding-right: 10px;
        font-size: 15px;
        font-weight: 600;
        color: var(--ahc-text-dark);
        margin-top: 4px; /* Tạo một khoảng cách nhỏ với ô input ở trên */
    }
}

/* === NÂNG CẤP GIAO DIỆN BƯỚC 1 & 3 === */

/* --- Step 1: Input --- */
.ahc-input-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--ahc-border-color);
}
.ahc-input-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.ahc-input-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--ahc-text-dark);
    font-size: 18px;
}
.ahc-input-hint {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
    margin-bottom: 15px;
}
.ahc-height-imperial {
    display: flex;
    gap: 10px;
}

/* --- Step 3: Results --- */
.ahc-result-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
}
.ahc-result-block {
    background-color: #f8f9fa;
    border: 1px solid var(--ahc-border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}
.ahc-result-block:first-child {
    grid-column: 1 / -1; /* BMI block takes full width */
}
.ahc-result-block h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ahc-primary-color);
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.ahc-result-block p {
    margin: 0 0 8px 0;
    line-height: 1.6;
    font-size: 14px;
}
.ahc-result-block p:last-child {
    margin-bottom: 0;
}
.ahc-result-block p > strong {
    color: var(--ahc-text-dark);
}
.ahc-result-block ul {
    list-style: none;
    padding: 10px 0 0 0;
    margin: 10px 0 0 0;
    border-top: 1px solid #e9ecef;
}
.ahc-result-block ul li {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 5px 0;
}
.ahc-result-block ul li span {
    font-weight: 700;
    color: #333;
}
#ahc-ideal-weight-result {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Trong file styles.css */

/* === THÊM VÀO CUỐI FILE === */

/* --- Logic cho Chế độ Đơn giản --- */
#ahc-container.ahc-mode-simple .ahc-advanced-section {
    display: none;
}

#ahc-container.ahc-mode-simple #ahc-energy-needs-result,
#ahc-container.ahc-mode-simple #ahc-body-composition-result {
    display: none;
}

/* Thêm vào cuối file styles.css */

/* --- Styles cho tính năng Lập Kế Hoạch Bữa Ăn --- */
#ahc-generate-plan-btn {
    margin-top: 15px;
    background-color: #5e72e4; /* Một màu khác để nổi bật */
}

#ahc-generate-plan-btn:hover {
    background-color: #324cdd;
}

.ahc-meal-plan-results {
    margin-top: 20px;
}

/* Các lớp này được AI tạo ra dựa trên prompt của chúng ta */
.meal-plan-wrapper .meal-plan-meal {
    background-color: #f8f9fa;
    border: 1px solid var(--ahc-border-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.meal-plan-wrapper .meal-plan-meal h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    color: var(--ahc-text-dark);
}

.meal-plan-wrapper .meal-plan-meal ul {
    list-style: none;
    padding-left: 5px;
    margin-bottom: 0;
}

.meal-plan-wrapper .meal-plan-meal li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 8px;
}

.meal-plan-wrapper .meal-plan-meal li::before {
    content: '✅';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--ahc-primary-color);
}

.meal-plan-wrapper .meal-plan-summary {
    margin-top: 20px;
    padding: 15px;
    background-color: #eef7ff;
    border-left: 4px solid #5e72e4;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.7;
}

/* Thêm vào cuối file styles.css */
.ahc-cultural-notice {
    margin-bottom: 15px;
}

/* Thêm vào cuối file styles.css */

/* --- Styles cho Kế hoạch Tuần & Slider --- */
#ahc-generate-weekly-plan-btn {
    margin-top: 15px;
    background-color: #2DCE89; /* Màu xanh lá */
}

#ahc-generate-weekly-plan-btn:hover {
    background-color: #24a46d;
}

.ahc-weekly-slider-wrapper {
    overflow: hidden;
    width: 100%;
    margin: 20px 0;
}

.ahc-weekly-slider {
    display: flex;
    width: 700%; /* 7 ngày x 100% */
    transition: transform 0.5s ease-in-out;
}

.ahc-weekly-slide {
    width: calc(100% / 7);
    padding: 0 10px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.ahc-weekly-slide h3 {
    text-align: center;
    color: var(--ahc-primary-color);
    font-size: 22px;
}

.ahc-weekly-slide h3 small {
    font-size: 16px;
    color: var(--ahc-text-light);
    font-weight: normal;
}

#ahc-weekly-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.ahc-slider-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ahc-slider-nav button {
    width: 35%;
    padding: 10px;
}

#ahc-day-indicator {
    font-weight: 600;
    font-size: 16px;
    color: var(--ahc-text-dark);
}

#ahc-download-plan-btn {
    background-color: #117a8b; /* Màu xanh đậm */
}
#ahc-download-plan-btn:hover {
    background-color: #0d5f6e;
}

/* Thêm vào cuối file styles.css */

/* --- Hiển thị icon cho danh sách món ăn trong thực đơn tuần --- */
.ahc-weekly-slide .meal-plan-meal li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 8px;
    list-style: none; /* Đảm bảo không có dấu chấm mặc định */
}

.ahc-weekly-slide .meal-plan-meal li::before {
    content: attr(data-icon);
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 1.1em;
}

.meal-plan-summary {
    display: block;
    margin-top: 8px;
    font-size: 0.9em;
    color: #555;
    border-left: 3px solid var(--ahc-primary-color);
    padding-left: 10px;
    font-style: normal;
    text-align: justify;
}

/* === THÊM VÀO CUỐI FILE === */

/* --- Styles cho Shortcode [health_calculator] --- */
#ahc-calculator-container {
    max-width: 700px; 
    margin: 20px auto; 
    font-family: var(--ahc-font-family); 
}

#ahc-calculator-results-wrapper {
    margin-top: 25px;
}

.ahc-calculator-result-card {
    background-color: #FFFFFF;
    border: 1px solid var(--ahc-border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 25px;
    text-align: center;
}

/* --- Nút Kêu Gọi Hành Động (CTA) --- */
.ahc-cta-button {
    display: inline-block;
    margin-top: 20px;
    padding: 16px 30px;
    background: linear-gradient(45deg, #FF6B6B, #f9a825);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

.ahc-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    animation-play-state: paused;
}

.ahc-cta-button .cta-main-text {
    display: block;
}

.ahc-cta-button .cta-sub-text {
    display: block;
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 4px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* === THÊM VÀO CUỐI FILE === */

/* --- Styles cho Hướng dẫn sử dụng (Guide Modal) --- */

/* Nút "Cần hướng dẫn?" */
.ahc-guide-link {
    display: block;
    text-align: right;
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 15px;
    color: var(--ahc-primary-color);
    text-decoration: none;
    font-weight: 600;
}
.ahc-guide-link:hover {
    text-decoration: underline;
}

/* Lớp phủ cho modal */
.ahc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Nội dung modal */
.ahc-modal-content {
    background-color: #fff;
    padding: 25px 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Nút đóng (dấu X) */
.ahc-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}
.ahc-modal-close:hover {
    color: #333;
}

.ahc-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--ahc-primary-color);
    text-align: center;
    font-size: 24px;
}

.ahc-guide-section {
    margin-bottom: 20px;
}
.ahc-guide-section:last-child {
    margin-bottom: 0;
}

.ahc-guide-section h4 {
    font-size: 18px;
    color: var(--ahc-text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.ahc-guide-icon {
    font-size: 20px;
    margin-right: 10px;
}

.ahc-guide-section p, .ahc-guide-section ul {
    font-size: 15px;
    line-height: 1.7;
    color: var(--ahc-text-light);
    margin: 0;
}

.ahc-guide-section ul {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}
.ahc-guide-section > ul > li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.ahc-guide-section > ul > li::before {
    content: '▸';
    position: absolute;
    left: 5px;
    top: 0;
    color: var(--ahc-primary-color);
    font-weight: bold;
}
.ahc-guide-section ul ul {
    margin-top: 8px;
    margin-left: 20px;
}
 .ahc-guide-section ul ul li::before {
    content: '–';
 }

.ahc-guide-summary {
    background-color: #eef7ff;
    border-left: 4px solid #5e72e4;
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
}
.ahc-guide-summary p {
    color: #333;
}

/* === THÊM VÀO CUỐI FILE === */

/* --- Styles cho Card Đóng/Mở (Collapsible Card) --- */
.ahc-collapsible-card {
    background-color: #f8f9fa;
    border: 1px solid var(--ahc-border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}
.ahc-collapsible-card.is-open {
    background-color: #fff;
}

.ahc-collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
}

.ahc-collapsible-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ahc-text-dark);
}

.ahc-arrow-icon {
    fill: var(--ahc-text-light);
    transition: transform 0.3s ease-in-out;
}

/* Xoay mũi tên khi card được mở */
.ahc-collapsible-card.is-open .ahc-arrow-icon {
    transform: rotate(180deg);
}

.ahc-collapsible-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid var(--ahc-border-color);
}

/* === THÊM VÀO CUỐI FILE === */

/* --- Styles cho tính năng nâng cao ở Kế hoạch bữa ăn --- */

/* Lựa chọn chế độ ăn */
.ahc-diet-options {
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}
.ahc-diet-options > strong {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--ahc-text-dark);
}
.ahc-radio-group-diet {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}
.ahc-radio-group-diet label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    cursor: pointer;
}

/* Vùng loại trừ món ăn */
#ahc-exclude-items-wrapper {
    margin-top: 20px;
}
#ahc-excluded-items-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
}
#ahc-excluded-items-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f1f1f1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
#ahc-regenerate-plan-btn {
    background-color: var(--ahc-secondary-color);
}
#ahc-regenerate-plan-btn:hover {
    background-color: var(--ahc-secondary-hover);
}
@media (max-width: 768px) {
    #ahc-excluded-items-list {
        grid-template-columns: 1fr;
    }
}

/* === THÊM VÀO CUỐI FILE === */

/* --- Dải phân cách "HOẶC" --- */
.ahc-or-separator {
    text-align: center;
    margin: 25px 0;
    position: relative;
    color: #000000;
    font-weight: 600;
    font-size: 14px;
}
.ahc-or-separator::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background-color: var(--ahc-border-color);
    z-index: 1;
}
.ahc-or-separator span {
    background-color: #fff;
    padding: 0 15px;
    position: relative;
    z-index: 2;
}


/* --- Nút bỏ qua phân tích (kiểu link) --- */
.ahc-button.secondary-link {
    background-color: transparent;
    color: var(--ahc-primary-color);
    font-weight: 600;
    padding: 10px;
    width: auto; /* Không chiếm toàn bộ chiều rộng */
    display: inline-block;
    border-radius: 6px;
    transition: background-color 0.3s;
}
.ahc-button.secondary-link:hover {
    background-color: #f0fafa;
    color: var(--ahc-primary-hover);
    transform: none; /* Bỏ hiệu ứng di chuyển lên */
}

/* Căn giữa nút link */
#ahc-step-2 .ahc-card-body {
    text-align: center;
}

/* Ghi đè lại để nút trong footer không bị ảnh hưởng */
#ahc-step-2 .ahc-card-footer .ahc-button {
    width: 50%;
}
@media (max-width: 768px) {
    #ahc-step-2 .ahc-card-footer .ahc-button {
        width: 100%;
    }
}

/* === THÊM VÀO CUỐI FILE === */

/* --- Styles cho Giao diện Phân tích Thực phẩm Đơn lẻ --- */
.ahc-single-item-card {
    background-color: #f8f9fa;
    border: 1px solid var(--ahc-border-color);
    border-radius: 12px;
    padding: 20px 25px;
    text-align: center;
}

.ahc-single-item-card h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--ahc-text-dark);
    font-weight: 400;
}

.ahc-single-item-card h3 strong {
    font-weight: 700;
    color: var(--ahc-primary-color);
}

.ahc-nutrition-facts {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--ahc-border-color);
}

.ahc-nutrition-main .value {
    font-size: 48px;
    font-weight: 700;
    color: var(--ahc-primary-color);
    line-height: 1;
}
.ahc-nutrition-secondary .value {
    font-size: 28px;
    font-weight: 600;
    color: var(--ahc-text-dark);
    line-height: 1;
}

.ahc-nutrition-main .unit,
.ahc-nutrition-secondary .unit {
    font-size: 18px;
    font-weight: 600;
    margin-left: 5px;
}
.ahc-nutrition-secondary .unit {
    font-size: 16px;
}

.ahc-nutrition-main .label,
.ahc-nutrition-secondary .label {
    display: block;
    font-size: 14px;
    color: var(--ahc-text-light);
    margin-top: 5px;
}

.ahc-item-description {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin: 0;
    text-align: justify;
}

@media (max-width: 480px) {
    .ahc-nutrition-facts {
        flex-direction: column;
        gap: 15px;
    }
}

/* === THÊM VÀO CUỐI FILE css/styles.css === */

/* --- Preloader Overlay --- */
#ahc-preloader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}
#ahc-preloader-content {
    text-align: center;
}
#ahc-preloader-content p {
    font-weight: 600;
    color: var(--ahc-text-dark);
    margin-top: 15px;
}

/* --- Vô hiệu hóa nút và thông báo giới hạn --- */
.ahc-button.ahc-action-disabled,
.ahc-button.ahc-action-disabled:hover {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

#ahc-usage-limit-notice {
    background-color: #fffbe6;
    border-left: 4px solid #f59e0b;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    text-align: center;
}
#ahc-usage-limit-notice p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #b45309;
}

/* === THÊM VÀO CUỐI FILE css/styles.css === */

/* --- Style cho văn bản trong Loader --- */
#ahc-suggestions-loader p,
#ahc-meal-plan-loader p,
#ahc-weekly-plan-loader p,
#ahc-advice-loader p {
    margin-top: 10px;
    font-weight: 600;
    color: var(--ahc-text-light);
    font-size: 15px;
    text-align: center;
}

/* --- Class vô hiệu hóa tạm thời trong khi tải nhiệm vụ (Nâng cấp) --- */
.ahc-button.ahc-task-loading,
.ahc-button.ahc-task-loading:hover {
    background-color: #e9ecef !important; /* Dùng !important để ghi đè các style khác */
    color: #6c757d !important;
    cursor: wait;
    transform: none;
    pointer-events: none;
    position: relative; /* Cần thiết để định vị spinner */
    transition: all 0.3s ease;
}

/* Ẩn văn bản gốc của nút khi loading */
.ahc-button.ahc-task-loading .ahc-button-text {
    visibility: hidden;
}

/* Spinner bên trong nút */
.ahc-button-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(108, 117, 125, 0.2);
    border-top-color: #6c757d;
    border-radius: 50%;
    animation: ahc-button-spin 0.8s linear infinite;
}

/* Dòng chữ loading bên dưới spinner */
.ahc-button-loading-text {
    position: absolute;
    top: calc(50% + 15px); /* Vị trí ngay dưới spinner */
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: normal;
    color: #6c757d;
}

@keyframes ahc-button-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Style cho nút link khi loading (Nâng cấp) */
#ahc-skip-analysis-btn.ahc-task-loading {
    color: #6c757d !important;
    pointer-events: none;
    cursor: wait;
    background-color: transparent !important; /* Đảm bảo nền luôn trong suốt */
    border: none !important; /* Bỏ mọi đường viền */
    box-shadow: none !important; /* Bỏ mọi bóng đổ */
}

/* Ẩn văn bản gốc và chỉ hiển thị trạng thái loading */
#ahc-skip-analysis-btn.ahc-task-loading .ahc-button-text {
    visibility: hidden;
}

/* Thêm spinner nhỏ và chữ "Đang tải..." vào vị trí của văn bản cũ */
#ahc-skip-analysis-btn.ahc-task-loading::after {
    content: 'Đang tải dữ liệu của bạn...';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-style: normal; /* Trả về font bình thường */
    display: inline-block;
    padding-left: 20px; /* Tạo không gian cho spinner */
}

#ahc-skip-analysis-btn.ahc-task-loading::before {
    content: '';
    position: absolute;
    left: calc(50% - 40px); /* Điều chỉnh vị trí spinner */
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid rgba(108, 117, 125, 0.2);
    border-top-color: #6c757d;
    border-radius: 50%;
    animation: ahc-button-spin 0.8s linear infinite;
}

/* === Bổ sung CSS cho các thành phần mới === */

/* --- Mục tiêu ở Bước 2 --- */
.ahc-goal-section {
    border-top: none !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.ahc-goal-section h4 {
    color: var(--ahc-primary-color);
}
.ahc-or-separator span {
    background-color: #F4F7F6; /* Match wizard background */
}

/* --- Các nút hành động ở Bước 3 --- */
.ahc-result-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    border-top: 1px solid var(--ahc-border-color);
    padding-top: 20px;
}

/* --- Định dạng cho Kế hoạch Toàn diện từ AI --- */
#ahc-comprehensive-plan-container {
    text-align: left;
    line-height: 1.7;
    color: var(--ahc-text-dark);
}
.ahc-plan-section {
    margin-bottom: 30px;
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--ahc-border-color);
    text-align: justify;
}
.ahc-plan-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.ahc-plan-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ahc-primary-color);
    margin-bottom: 15px;
}

/* Định dạng thẻ ngày */
.ahc-day-card {
    background: #f8f9fa;
    border: 1px solid var(--ahc-border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
}
.ahc-day-card h4 {
    margin-top: 0;
    color: #333;
}

.ahc-meal {
    margin-bottom: 10px;
}
.ahc-meal strong {
    color: var(--ahc-text-dark);
}
.ahc-meal ul {
    list-style-type: '- ';
    padding-left: 20px;
}

/* Định dạng Kế hoạch Luyện tập */
.ahc-workout-day h4 {
    border-bottom: 2px solid var(--ahc-primary-color);
    padding-bottom: 5px;
    display: inline-block;
}

.ahc-exercise {
    margin-bottom: 20px;
}
.ahc-exercise h5 {
    font-size: 16px;
    margin-bottom: 8px;
}
.ahc-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-top: 10px;
    border-radius: 8px;
}
.ahc-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .ahc-result-actions {
        flex-direction: column;
    }
}

/* === BỔ SUNG CSS CHO GIAO DIỆN TAB (PHIÊN BẢN TỐI ƯU MOBILE) === */

/* --- Thanh điều hướng TAB --- */
.ahc-tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--ahc-border-color);
    margin-bottom: 20px;
    background-color: #ffffff; /* Thêm nền trắng để ghim */
}

/* --- Nội dung TAB --- */
.ahc-tab-pane {
    display: none;
    animation: fadeIn 0.5s;
}

.ahc-tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Bố cục lưới cho Dinh dưỡng & Luyện tập --- */
.ahc-daily-plan-grid {
    display: grid;
    gap: 30px;
    text-align: justify;
}

.ahc-plan-subtitle {
    font-size: 18px;
    font-weight: 600;
    color: var(--ahc-text-dark);
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ahc-border-color);
}

/* === GIAO DIỆN DESKTOP (Màn hình rộng hơn 768px) === */
@media (min-width: 769px) {
    /* Thanh TAB bình thường */
    .ahc-tabs-nav {
        flex-wrap: wrap; /* Cho phép xuống dòng nếu không đủ chỗ */
        gap: 0px;
    }

    .ahc-tab-link {
        padding: 10px 20px;
        cursor: pointer;
        border: none;
        background-color: transparent;
        font-size: 16px;
        font-weight: 600;
        color: var(--ahc-text-light);
        position: relative;
        transition: color 0.3s ease;
        border-radius: 6px 6px 0 0; /* Bo góc nhẹ ở trên */
    }

    .ahc-tab-link::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: var(--ahc-primary-color);
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }

    .ahc-tab-link:hover,
    .ahc-tab-link:focus {
        color: var(--ahc-text-dark);
        background-color: #f0f0f0;
        outline: none;
    }

    .ahc-tab-link.active {
        color: var(--ahc-primary-color);
    }
    .ahc-tab-link.active::after {
        transform: scaleX(1);
    }

    /* Bố cục 2 cột */
    .ahc-daily-plan-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* === GIAO DIỆN MOBILE (Màn hình tối đa 768px) === */
@media (max-width: 768px) {
    /* Ghim thanh TAB */
    .ahc-tabs-nav {
        position: sticky;
        top: 0; /* Ghim ở trên cùng */
        z-index: 999;
        overflow-x: auto; /* Cho phép cuộn ngang */
        overflow-y: hidden;
        white-space: nowrap; /* Ngăn các nút tab xuống dòng */
        -webkit-overflow-scrolling: touch; /* Cuộn mượt hơn trên iOS */
        scrollbar-width: none; /* Ẩn thanh cuộn trên Firefox */
    }
    /* Ẩn thanh cuộn trên Chrome/Safari */
    .ahc-tabs-nav::-webkit-scrollbar {
        display: none;
    }

    /* Style cho các nút TAB trên mobile */
    .ahc-tab-link {
        display: inline-block; /* Để các nút nằm trên 1 hàng */
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 600;
        color: var(--ahc-text-light);
        border: none;
        background: none;
        border-bottom: 2px solid transparent;
        transition: all 0.3s ease;
        flex-shrink: 0; /* Ngăn các nút bị co lại */
    }

    .ahc-tab-link.active {
        color: var(--ahc-primary-color);
        border-bottom-color: var(--ahc-primary-color);
    }

    /* Bố cục 1 cột */
    .ahc-daily-plan-grid {
        grid-template-columns: 1fr;
        gap: 0; /* Bỏ khoảng cách ngang */
    }
    /* Thêm khoảng cách dọc giữa 2 phần */
    .ahc-daily-plan-grid .ahc-plan-section:first-child {
        margin-bottom: 5px;
    }
}

/* === CSS CHO KHU VỰC TOKEN USAGE === */
.ahc-api-usage {
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px solid var(--ahc-border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--ahc-text-light);
    text-align: center;
}
.ahc-api-usage strong {
    color: var(--ahc-text-dark);
}

/* === BỔ SUNG CSS CHO DANH SÁCH TRONG NỘI DUNG AI === */

/* Áp dụng cho tất cả các danh sách (ul) trong khu vực kết quả */
#ahc-comprehensive-plan-container ul {
    list-style: none; /* Bỏ các dấu chấm tròn mặc định */
    padding-left: 5px; /* Giảm khoảng cách lề trái */
    margin-top: 15px;
    margin-bottom: 15px;
    margin: 0em 0em 0.5em 0.5em !important;
}

/* Định dạng cho từng mục trong danh sách (li) */
#ahc-comprehensive-plan-container ul li {
    position: relative;
    padding-left: 25px; /* Tạo không gian cho icon đầu dòng */
    margin-bottom: 10px; /* Tạo khoảng cách giữa các dòng */
    line-height: 1.6; /* Tăng chiều cao dòng cho dễ đọc */
    color: var(--ahc-text-dark); /* Đảm bảo chữ có màu */
}

/* Thêm icon tùy chỉnh cho mỗi mục */
#ahc-comprehensive-plan-container ul li::before {
    content: '🔹'; /* Bạn có thể đổi icon này, ví dụ: '✅', '➡️', '✨' */
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--ahc-primary-color); /* Dùng màu chủ đạo của plugin */
    font-size: 1.1em;
}

/* === TỐI ƯU GIAO DIỆN BƯỚC 2 === */

.ahc-step2-body {
    background-color: #F4F7F6; /* Màu nền giống wizard để tạo cảm giác liền mạch */
    padding: 15px;
}

.ahc-step2-card {
    background-color: #FFFFFF;
    border: 1px solid var(--ahc-border-color);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ahc-step2-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--ahc-border-color);
}

.ahc-step2-icon {
    font-size: 28px;
    line-height: 1;
}

.ahc-step2-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--ahc-text-dark);
    font-weight: 600;
}

.ahc-step2-card-body {
    padding: 20px;
}

/* Tinh chỉnh lại dải phân cách */
.ahc-or-separator {
    margin: 20px 0;
    display: none;
}
.ahc-or-separator span {
    background-color: #F4F7F6; /* Match the new body background */
}

/* Căn giữa nút bỏ qua */
.ahc-skip-container {
    text-align: center;
}

.ahc-step2-card-food {
    display: none;
}
/* --- Class vô hiệu hóa tạm thời trong khi tải nhiệm vụ (Nâng cấp v3 - Sửa lỗi vị trí) --- */

/* Wrapper chính cần có position relative để định vị spinner */
.ahc-primary-action-wrapper {
    position: relative;
    /* flex-grow đã được xử lý ở trên, không cần ở đây nữa */
}

.ahc-button.ahc-task-loading,
.ahc-button.ahc-task-loading:hover {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: wait;
    transform: none;
    pointer-events: none;
    opacity: 0.6;
}

/* Ẩn văn bản và icon gốc của nút khi loading */
.ahc-button.ahc-task-loading .ahc-button-text,
.ahc-button.ahc-task-loading::before {
    visibility: hidden;
}

/* Spinner được đặt ở giữa wrapper, ngay trên nút */
.ahc-primary-action-wrapper .ahc-button-spinner {
    position: absolute;
    /* top: 50% tính từ đỉnh của wrapper, dịch lên 1 nửa chiều cao nút + 1 nửa chiều cao text note */
    top: calc(50% - 1.2em); 
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(108, 117, 125, 0.2);
    border-top-color: #6c757d;
    border-radius: 50%;
    animation: ahc-button-spin 0.8s linear infinite;
    z-index: 10;
}

/* Dòng chữ loading nằm dưới spinner */
.ahc-primary-action-wrapper .ahc-button-loading-text {
    position: absolute;
    top: calc(50% + 5px); /* Điều chỉnh vị trí dưới nút */
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    font-weight: 600;
    color: var(--ahc-text-light);
    white-space: nowrap;
    z-index: 10;
}

@keyframes ahc-button-spin {
    to {
        transform: rotate(360deg);
    }
}

/* === THÊM VÀO CUỐI FILE === */
/* --- Tối ưu Modal Hướng dẫn cho Mobile --- */
@media (max-width: 600px) {
    .ahc-modal-content {
        padding: 20px 15px;
        max-height: 65vh; /* Giới hạn chiều cao */
        overflow-y: auto; /* Cho phép cuộn nếu nội dung dài */
    }

    .ahc-modal-content h3 {
        font-size: 20px;
    }

    .ahc-guide-section h4 {
        font-size: 16px;
    }
    
    .ahc-guide-section p, .ahc-guide-section ul {
        font-size: 14px;
    }
}

/* === THÊM VÀO CUỐI FILE === */
/* --- Sửa lỗi tràn giao diện kết quả trên Mobile --- */
@media (max-width: 768px) {
    /* Giảm padding của card chính trên màn hình nhỏ */
    .ahc-calculator-result-card {
        padding: 20px 15px;
    }

    /* Giảm padding của các khối kết quả bên trong */
    .ahc-result-block {
        padding: 15px 10px;
    }

    /* Đảm bảo chữ không bị quá lớn và xuống dòng hợp lý */
    .ahc-result-block p {
        font-size: 13px; /* Giảm kích thước font một chút */
        word-wrap: break-word; /* Cho phép chữ tự ngắt nếu cần */
    }

    /* Điều chỉnh lại kích thước font cho phần BMI */
    #ahc-bmi-text-result .bmi-value-wrapper span {
        font-size: 36px;
    }
    #ahc-bmi-text-result .bmi-category {
        font-size: 15px;
    }
    
    /* Điều chỉnh kích thước font cho nút CTA */
    .ahc-cta-button {
        padding: 14px 25px;
        font-size: 13px;
    }
    .ahc-cta-button .cta-sub-text {
        font-size: 11px;
    }
}

/* === THÊM VÀO CUỐI FILE === */
/* --- Style cho khối hiển thị lỗi và nút Thử lại --- */
.ahc-error-container {
    text-align: center;
    padding: 20px;
}
.ahc-error-container .ahc-notice {
    text-align: left;
    margin-bottom: 20px;
}
.ahc-error-container .ahc-notice p {
    color: #991b1b; /* Màu chữ đỏ sẫm */
}
.ahc-error-container .ahc-notice strong {
    color: #b91c1c; /* Màu chữ đỏ đậm hơn */
}

#ahc-retry-btn {
    max-width: 250px;
    margin: 0 auto;
    background-color: var(--ahc-primary-color);
}
#ahc-retry-btn:hover {
     background-color: var(--ahc-primary-hover);
}

/* === THÊM VÀO CUỐI FILE === */
/* --- Cải thiện giao diện 2 cột Dinh dưỡng & Luyện tập trên Desktop --- */
@media (min-width: 769px) {
    .ahc-daily-plan-grid {
        position: relative; /* Cần thiết để định vị đường kẻ dọc */
        padding: 15px 0;
    }

    /* Tạo đường kẻ dọc giả bằng ::before */
    .ahc-daily-plan-grid::before {
        content: '';
        position: absolute;
        left: 50%;
        top: 0;
        bottom: 0;
        width: 1px;
        background-color: var(--ahc-border-color, #e0e0e0);
        transform: translateX(-50%); /* Căn giữa đường kẻ chính xác */
    }

    /* Điều chỉnh padding cho 2 cột để không bị dính vào đường kẻ */
    .ahc-daily-plan-grid .ahc-plan-section:nth-child(1) { /* Cột Dinh dưỡng */
        padding-right: 30px;
    }

    .ahc-daily-plan-grid .ahc-plan-section:nth-child(2) { /* Cột Luyện tập */
        padding-left: 30px;
    }
}

/* === THÊM VÀO CUỐI FILE === */
/* --- Ẩn nút tải PDF trên Mobile --- */
    #ahc-download-pdf-btn {
        display: none;
    }

canvas#ahc-bmi-gauge-chart {
    height: 130px !important;
}

/* === THÊM VÀO CUỐI FILE === */
/* --- Style cho Tiêu đề chính của Shortcode --- */
.ahc-main-heading {
    font-size: 28px;
    font-weight: 700;
    color: #00a99d;
    text-align: center;
    margin-bottom: 25px;
}

/* Tối ưu cho mobile */
@media (max-width: 768px) {
    .ahc-main-heading {
        font-size: 24px;
        line-height: 1.4;
    }
}