/* =====================================================================
   TRAVEL HOUSE VIETNAM — Design tokens & utility classes (hợp đồng §9)
   File này CHỨA: biến CSS + class dùng chung cho mọi agent.
   KHÔNG chứa CSS riêng của từng trang (site.css / admin.css do agent khác viết).
   ===================================================================== */

:root {
    /* ---- Màu thương hiệu ---- */
    --thv-primary: #1e6fd9;
    --thv-primary-dark: #1558b0;
    --thv-navy: #0c2d6b;
    --thv-navy-2: #1e3a7b;
    --thv-accent: #f97316;
    --thv-accent-dark: #ea6c0a;
    --thv-success: #16a34a;
    --thv-teal: #00bb7f;
    --thv-purple: #9333ea;
    --thv-gold: #d4af37;
    --thv-bg: #fafcff;
    --thv-soft: #eff6ff;
    --thv-ink: #0f172b;
    --thv-slate-800: #1e293b;
    --thv-slate-600: #364153;
    --thv-slate-500: #45556c;
    --thv-slate-400: #90a1b9;
    --thv-line: #e2e8f0;
    --thv-line-soft: #f1f5f9;
    --thv-white: #fff;
    --thv-danger: #dc2626;
    --thv-warning: #f59e0b;
    --thv-info: #0ea5e9;
    --thv-muted: #64748b;

    /* ---- Bo góc ---- */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-pill: 999px;

    /* ---- Bóng ---- */
    --sh-sm: 0 2px 8px rgba(15, 23, 43, .06);
    --sh-md: 0 8px 24px rgba(15, 23, 43, .10);
    --sh-lg: 0 14px 40px rgba(12, 45, 107, .16);

    /* ---- Font ---- */
    --thv-font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --thv-font-size: 15px;

    /* ---- Chuyển động ---- */
    --thv-ease: 250ms ease;
    --thv-lift: translateY(-6px);

    /* ---- Nền gradient ---- */
    --thv-grad-primary: linear-gradient(135deg, var(--thv-primary), var(--thv-primary-dark));
    --thv-grad-accent: linear-gradient(135deg, var(--thv-accent), var(--thv-accent-dark));
    --thv-grad-navy: linear-gradient(135deg, var(--thv-navy), var(--thv-navy-2));
}

/* ---------------------------------------------------------------------
   Nền tảng
   --------------------------------------------------------------------- */
body {
    font-family: var(--thv-font);
    font-size: var(--thv-font-size);
    color: var(--thv-ink);
    background: var(--thv-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--thv-primary-dark); }

::selection { background: var(--thv-soft); color: var(--thv-navy); }

/* ---------------------------------------------------------------------
   Card
   --------------------------------------------------------------------- */
.thv-card {
    background: var(--thv-white);
    border: 1px solid var(--thv-line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    transition: transform var(--thv-ease), box-shadow var(--thv-ease), border-color var(--thv-ease);
}

.thv-card:hover { border-color: #cddcf3; }

.thv-card--flat { box-shadow: none; }

.thv-card__body { padding: 18px 20px; }

/* Nâng khi hover (hero card, tour card, KPI) */
.thv-hover-lift { transition: transform var(--thv-ease), box-shadow var(--thv-ease); }

.thv-hover-lift:hover {
    transform: var(--thv-lift);
    box-shadow: var(--sh-lg);
}

/* ---------------------------------------------------------------------
   Nút
   --------------------------------------------------------------------- */
.thv-btn-primary,
.thv-btn-accent,
.thv-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    padding: 12px 22px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--thv-ease), box-shadow var(--thv-ease), filter var(--thv-ease);
    white-space: nowrap;
}

.thv-btn-primary {
    color: var(--thv-white);
    background: var(--thv-grad-primary);
    box-shadow: 0 6px 18px rgba(30, 111, 217, .28);
}

.thv-btn-primary:hover,
.thv-btn-primary:focus-visible {
    color: var(--thv-white);
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 10px 24px rgba(30, 111, 217, .34);
}

.thv-btn-accent {
    color: var(--thv-white);
    background: var(--thv-grad-accent);
    box-shadow: 0 6px 18px rgba(249, 115, 22, .30);
}

.thv-btn-accent:hover,
.thv-btn-accent:focus-visible {
    color: var(--thv-white);
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 10px 26px rgba(249, 115, 22, .36);
}

.thv-btn-ghost {
    color: var(--thv-primary-dark);
    background: var(--thv-white);
    border-color: var(--thv-line);
}

.thv-btn-ghost:hover { background: var(--thv-soft); color: var(--thv-navy); }

.thv-btn-primary:disabled,
.thv-btn-accent:disabled,
.thv-btn-ghost:disabled,
.thv-btn-primary.is-disabled,
.thv-btn-accent.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---------------------------------------------------------------------
   Badge trạng thái (khớp status_badge() / status_labels.php)
   status_badge() in ra: <span class="badge thv-badge thv-badge-{color}">
   --------------------------------------------------------------------- */
.thv-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: .2px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    white-space: nowrap;
    border: 1px solid transparent;
}

.thv-badge-muted { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

.thv-badge-primary { background: #e8f1fd; color: var(--thv-primary-dark); border-color: #cfe1fb; }

.thv-badge-success { background: #e7f7ee; color: #12703a; border-color: #c7ecd6; }

.thv-badge-warning { background: #fff4e0; color: #9a5b00; border-color: #ffe1b3; }

.thv-badge-danger { background: #fdeaea; color: #a11c1c; border-color: #f8cfcf; }

.thv-badge-info { background: #e6f6fe; color: #0b5f80; border-color: #c7e9fb; }

.thv-badge-navy { background: #e9edf8; color: var(--thv-navy); border-color: #d3dbef; }

.thv-badge-teal { background: #e3f8f1; color: #046a4d; border-color: #c4efe1; }

.thv-badge-purple { background: #f4e9fe; color: #6b21a8; border-color: #e8d5fc; }

.thv-badge-accent { background: #fff1e6; color: #b3480a; border-color: #ffd9bd; }

.thv-badge-gold { background: #fbf5e0; color: #8a6d10; border-color: #f0e3b0; }

/* Kích thước phụ */
.thv-badge-sm { font-size: 11px; padding: 2px 8px; }

.thv-badge-lg { font-size: 13px; padding: 6px 12px; }

/* ---------------------------------------------------------------------
   Section / tiêu đề trang
   --------------------------------------------------------------------- */
.thv-section {
    padding: 56px 0;
}

.thv-section--tight { padding: 32px 0; }

.thv-section--soft { background: var(--thv-soft); }

.thv-section--white { background: var(--thv-white); }

.section-title {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 26px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--thv-line);
}

.section-title h2,
h2.section-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--thv-navy);
    margin: 0;
    line-height: 1.3;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 72px;
    height: 3px;
    border-radius: var(--r-pill);
    background: var(--thv-grad-accent);
}

.section-title__sub { color: var(--thv-slate-500); font-size: 14px; margin: 6px 0 0; font-weight: 400; }

.section-title__more { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--thv-primary); }

.section-title__more:hover { color: var(--thv-navy); }

/* ---------------------------------------------------------------------
   Pill / chip
   --------------------------------------------------------------------- */
.thv-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--r-pill);
    background: var(--thv-white);
    border: 1px solid var(--thv-line);
    color: var(--thv-slate-600);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--thv-ease);
    cursor: pointer;
}

.thv-pill:hover { border-color: var(--thv-primary); color: var(--thv-primary-dark); background: var(--thv-soft); }

.thv-pill.is-active,
.thv-pill.active {
    background: var(--thv-grad-primary);
    border-color: transparent;
    color: var(--thv-white);
}

.thv-pill--soft { background: var(--thv-soft); border-color: transparent; }

/* ---------------------------------------------------------------------
   Text / helpers chung
   --------------------------------------------------------------------- */
.thv-text-primary { color: var(--thv-primary) !important; }
.thv-text-navy { color: var(--thv-navy) !important; }
.thv-text-accent { color: var(--thv-accent-dark) !important; }
.thv-text-muted-2 { color: var(--thv-slate-500) !important; }
.thv-text-gold { color: var(--thv-gold) !important; }
.thv-text-success { color: var(--thv-success) !important; }
.thv-text-danger { color: var(--thv-danger) !important; }
.thv-bg-soft { background: var(--thv-soft) !important; }
.thv-bg-navy { background: var(--thv-navy) !important; color: #fff !important; }
.thv-rounded-sm { border-radius: var(--r-sm) !important; }
.thv-rounded-md { border-radius: var(--r-md) !important; }
.thv-rounded-lg { border-radius: var(--r-lg) !important; }
.thv-rounded-xl { border-radius: var(--r-xl) !important; }
.thv-rounded-pill { border-radius: var(--r-pill) !important; }
.thv-shadow-sm { box-shadow: var(--sh-sm) !important; }
.thv-shadow-md { box-shadow: var(--sh-md) !important; }
.thv-shadow-lg { box-shadow: var(--sh-lg) !important; }
.thv-price { font-weight: 800; color: var(--thv-accent-dark); font-size: 18px; }
.thv-price-old { color: var(--thv-slate-400); text-decoration: line-through; font-size: 13px; }
.thv-no-wrap { white-space: nowrap; }
.thv-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.thv-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------------
   Bảng: cho phép cuộn ngang gọn trên mobile
   --------------------------------------------------------------------- */
.table-min { min-width: 760px; }

.table-min--sm { min-width: 560px; }

.table-min--lg { min-width: 1100px; }

.table > :not(caption) > * > * { padding: 10px 12px; }

.table thead th {
    background: var(--thv-line-soft);
    color: var(--thv-slate-600);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--thv-line);
}

.table tbody tr:hover { background: #f8fbff; }

.table td { vertical-align: middle; }

/* ---------------------------------------------------------------------
   Scrollbar chung (sidebar admin, khung chọn, bảng ngang)
   --------------------------------------------------------------------- */
.thv-scroll,
.table-responsive,
.thv-scroll-x {
    scrollbar-width: thin;
    scrollbar-color: var(--thv-slate-400) transparent;
}

.thv-scroll::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.thv-scroll-x::-webkit-scrollbar {
    height: 9px;
    width: 9px;
}

.thv-scroll::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: var(--thv-line-soft);
    border-radius: var(--r-pill);
}

.thv-scroll::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.thv-scroll-x::-webkit-scrollbar-thumb {
    background: var(--thv-slate-400);
    border-radius: var(--r-pill);
}

.thv-scroll::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--thv-primary);
}

.thv-scroll--hidden::-webkit-scrollbar { display: none; }

.thv-scroll--hidden { scrollbar-width: none; }

/* ---------------------------------------------------------------------
   Form chung
   --------------------------------------------------------------------- */
.form-label,
.thv-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--thv-slate-500);
    margin-bottom: 5px;
}

.form-control,
.form-select {
    border-radius: var(--r-sm);
    border-color: var(--thv-line);
    font-size: 14px;
    padding: 9px 12px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--thv-primary);
    box-shadow: 0 0 0 .2rem rgba(30, 111, 217, .14);
}

.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--thv-danger); }

.thv-invalid-feedback { color: var(--thv-danger); font-size: 12.5px; margin-top: 4px; }

/* ---------------------------------------------------------------------
   Flash alert (flash_render())
   --------------------------------------------------------------------- */
.thv-flash {
    border: 1px solid var(--thv-line);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
    font-size: 14px;
    align-items: center;
}

.thv-flash.alert-success { background: #e7f7ee; border-color: #c7ecd6; color: #12703a; }
.thv-flash.alert-warning { background: #fff4e0; border-color: #ffe1b3; color: #9a5b00; }
.thv-flash.alert-danger { background: #fdeaea; border-color: #f8cfcf; color: #a11c1c; }
.thv-flash.alert-info { background: #e6f6fe; border-color: #c7e9fb; color: #0b5f80; }

/* ---------------------------------------------------------------------
   Phân trang (pagination())
   --------------------------------------------------------------------- */
.thv-pagination { gap: 10px; margin-top: 14px; }

.pagination .page-link {
    border-radius: var(--r-sm);
    margin: 0 2px;
    color: var(--thv-slate-600);
    border-color: var(--thv-line);
    font-size: 13px;
    min-width: 34px;
    text-align: center;
}

.pagination .page-item.active .page-link {
    background: var(--thv-grad-primary);
    border-color: transparent;
    color: var(--thv-white);
    font-weight: 700;
}

.pagination .page-item.disabled .page-link { color: var(--thv-slate-400); background: var(--thv-line-soft); }

/* ---------------------------------------------------------------------
   Ảnh/Card loader
   --------------------------------------------------------------------- */
.thv-skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #f7fafc 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: thv-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--r-sm);
}

@keyframes thv-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

@media (max-width: 767.98px) {
    .thv-section { padding: 34px 0; }
    .section-title h2, h2.section-title { font-size: 21px; }
    .thv-btn-primary, .thv-btn-accent, .thv-btn-ghost { width: 100%; }
}
