﻿/* ============================================================
   SmartTravelAI - travel-themed Bootstrap 5 design system
   Font: Be Vietnam Pro (sans) + Lora (display) -- tối ưu tiếng Việt
   ============================================================ */
:root {
    --stv-primary: #0ea5a4;
    --stv-primary-dark: #0b827f;
    --stv-accent: #ff6b6b;
    --stv-accent-2: #ffb45c;
    --stv-bg: #f6f9fb;
    --stv-text: #1f2937;
    --stv-muted: #6b7280;
    --stv-card: #ffffff;
    --stv-border: #e5e7eb;
    --stv-shadow: 0 6px 24px rgba(15, 23, 42, .08);
    --stv-shadow-lg: 0 20px 60px rgba(15, 23, 42, .15);
    --stv-radius: 14px;
    --stv-font-sans: 'Be Vietnam Pro', 'Segoe UI', 'Roboto', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
    --stv-font-display: 'Lora', 'Be Vietnam Pro', 'Segoe UI', serif;
    /* override Bootstrap defaults so mọi component (button, modal, dropdown...) dùng đồng nhất */
    --bs-font-sans-serif: 'Be Vietnam Pro', 'Segoe UI', 'Roboto', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
}

html, body {
    background: var(--stv-bg);
    color: var(--stv-text);
    font-family: var(--stv-font-sans);
    font-feature-settings: "kern", "liga", "ccmp", "locl";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, .stv-hero h1, .stv-section h2, .navbar-brand, .stv-card h5,
.btn, .nav-link, label, input, textarea, select, button {
    font-family: var(--stv-font-sans);
}
a { color: var(--stv-primary-dark); text-decoration: none; }
a:hover { color: var(--stv-primary); }

.navbar.stv-nav {
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--stv-border);
    padding: .5rem 0;
}
.stv-nav > .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .5rem;
}
.stv-nav .navbar-brand {
    flex-shrink: 0;
    font-weight: 800;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--stv-primary) 0%, var(--stv-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-right: .25rem;
}
.stv-nav .navbar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}
.stv-nav .nav-item { flex-shrink: 0; }
.stv-nav .nav-link {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: .3rem;
    white-space: nowrap !important;
    font-weight: 500;
    color: #475569;
    font-size: .8125rem;
    padding: .35rem .45rem;
    line-height: 1.2;
}
.stv-nav .nav-link > i.bi {
    display: inline-block !important;
    flex: 0 0 auto;
    font-size: 1rem;
    line-height: 1;
}
.stv-nav .nav-link.active, .stv-nav .nav-link:hover { color: var(--stv-primary-dark); }
.stv-nav .badge-pro {
    display: inline-block;
    flex-shrink: 0;
    background: linear-gradient(135deg, #facc15 0%, #f97316 100%);
    color: #1f2937;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .62rem;
    padding: .2em .45em;
    margin: 0 0 0 .2rem;
    border-radius: 6px;
    vertical-align: middle;
}
.stv-nav .stv-nav-search {
    flex: 0 0 auto;
    min-width: 0;
}
.stv-nav .stv-nav-search .input-group {
    width: 11rem;
}
.stv-nav .stv-nav-search .form-control {
    font-size: .8125rem;
    padding: .4rem .65rem;
}
.stv-nav .stv-nav-search .input-group-text {
    padding: .4rem .55rem;
}
.stv-nav .navbar-nav.stv-nav-auth {
    flex-shrink: 0;
}
@media (min-width: 1200px) {
    .stv-nav .stv-nav-search .input-group { width: 13rem; }
    .stv-nav .nav-link { font-size: .875rem; padding: .4rem .5rem; }
}
@media (min-width: 992px) {
    .stv-nav.navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        flex-grow: 1;
        flex-basis: auto;
        min-width: 0;
        gap: .35rem;
    }
    .stv-nav .stv-nav-menu {
        flex: 1 1 auto;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .stv-nav .stv-nav-menu::-webkit-scrollbar { height: 4px; }
}

.btn-primary, .btn-stv-primary {
    background: linear-gradient(135deg, var(--stv-primary) 0%, var(--stv-primary-dark) 100%);
    border: 0;
    color: #fff;
    box-shadow: 0 6px 18px rgba(14, 165, 164, .35);
    transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover, .btn-stv-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(14, 165, 164, .45);
    color: #fff;
}
.btn-outline-stv {
    border: 1.5px solid var(--stv-primary);
    color: var(--stv-primary-dark);
    background: #fff;
    font-weight: 600;
}
.btn-outline-stv:hover {
    background: var(--stv-primary);
    color: #fff;
}

/* ---------- HERO ---------- */
.stv-hero {
    background: radial-gradient(120% 80% at 0% 0%, #cffafe 0%, transparent 60%),
                radial-gradient(120% 80% at 100% 100%, #fde68a 0%, transparent 60%),
                linear-gradient(180deg, #ecfeff 0%, #fff 100%);
    padding: 4.5rem 0 3rem;
    overflow: hidden;
    position: relative;
}
.stv-hero h1 {
    font-weight: 800;
    font-size: clamp(2rem, 4vw + 1rem, 3.6rem);
    line-height: 1.05;
    letter-spacing: -.03em;
}
.stv-hero h1 .grad {
    background: linear-gradient(135deg, var(--stv-primary-dark) 0%, var(--stv-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stv-hero .stv-search {
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--stv-shadow-lg);
    padding: .4rem;
    display: flex;
    gap: .25rem;
    align-items: stretch;
}
.stv-hero .stv-search input {
    border: 0;
    flex: 1;
    padding: .9rem 1.2rem;
    border-radius: 999px;
    font-size: 1.05rem;
    background: transparent;
    outline: 0;
}
.stv-hero .stv-search button {
    border: 0;
    background: linear-gradient(135deg, var(--stv-primary) 0%, var(--stv-primary-dark) 100%);
    color: #fff;
    border-radius: 999px;
    font-weight: 600;
    padding: 0 1.6rem;
}
.stv-hero .stv-chips { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.stv-hero .stv-chips a {
    background: rgba(255, 255, 255, .8);
    border: 1px solid var(--stv-border);
    border-radius: 999px;
    padding: .35rem .85rem;
    font-size: .9rem;
    color: var(--stv-text);
}
.stv-hero .stv-chips a:hover { background: var(--stv-primary); color: #fff; border-color: var(--stv-primary); }

/* ---------- CARDS ---------- */
.stv-section { padding: 2.5rem 0; }
.stv-section h2 {
    font-weight: 800;
    font-size: 1.65rem;
    letter-spacing: -.02em;
}
.stv-section .lead { color: var(--stv-muted); margin-bottom: 1.5rem; }

/* ---------- PAGINATION ---------- */
.stv-pagination .pagination .page-link {
    color: var(--stv-primary-dark);
    border-color: var(--stv-border);
    border-radius: 8px !important;
    margin: 0 2px;
}
.stv-pagination .pagination .page-item.active .page-link {
    background: var(--stv-primary);
    border-color: var(--stv-primary);
    color: #fff;
}
.stv-pagination .pagination .page-link:hover {
    background: #e6f7f7;
    border-color: var(--stv-primary);
    color: var(--stv-primary-dark);
}

.stv-card {
    background: var(--stv-card);
    border: 1px solid var(--stv-border);
    border-radius: var(--stv-radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
/* Equal-height cards only in grid columns (place/hotel listings) */
.row > [class*="col"] > .stv-card,
.row > [class*="col"] > a.stv-card {
    height: 100%;
}
.stv-card:hover { transform: translateY(-3px); box-shadow: var(--stv-shadow); }
.stv-card-img { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: #e5e7eb; }
.stv-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.stv-card:hover .stv-card-img img { transform: scale(1.06); }
.stv-card-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.stv-card .stv-tag {
    position: absolute; top: 10px; left: 10px;
    background: rgba(0, 0, 0, .55); color: #fff;
    font-size: .72rem; font-weight: 600;
    padding: .25rem .55rem; border-radius: 999px;
    backdrop-filter: blur(6px);
}
.stv-card .stv-trend {
    position: absolute; top: 10px; right: 10px;
    background: linear-gradient(135deg, var(--stv-accent) 0%, var(--stv-accent-2) 100%);
    color: #fff;
    font-size: .72rem; font-weight: 700;
    padding: .25rem .6rem; border-radius: 999px;
}
.stv-card h5 {
    font-size: 1rem; font-weight: 700; margin: 0; color: var(--stv-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.stv-card .stv-meta {
    color: var(--stv-muted);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.stv-card .stv-meta .star { color: #f59e0b; }
.stv-card .stv-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .25rem; }
.stv-card .stv-tags span {
    font-size: .72rem; padding: .12rem .55rem;
    background: #f1f5f9; border-radius: 999px; color: #475569;
}
.stv-card .stv-fav-btn {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255, 255, 255, .9); border: 0; border-radius: 999px;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--stv-accent); font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.stv-card .stv-fav-btn.favorited { color: #ef4444; background: #fff0f0; }

/* ---------- CITY / CATEGORY PILLS ---------- */
.stv-pill {
    display: flex; align-items: center; gap: .55rem;
    background: #fff;
    border: 1px solid var(--stv-border);
    padding: .55rem 1rem;
    border-radius: 999px;
    font-weight: 600; color: var(--stv-text);
    transition: all .2s;
}
.stv-pill:hover { border-color: var(--stv-primary); color: var(--stv-primary-dark); transform: translateY(-1px); }
.stv-pill i { color: var(--stv-primary); }

/* ---------- TIMELINE ---------- */
.stv-timeline {
    position: relative;
    padding-left: 2.5rem;
}
.stv-timeline::before {
    content: ""; position: absolute; left: 1rem; top: 0; bottom: 0;
    width: 2px; background: linear-gradient(180deg, var(--stv-primary) 0%, var(--stv-accent) 100%);
}
.stv-timeline .stv-tl-item {
    position: relative; margin-bottom: 1.4rem;
    background: #fff; padding: 1rem 1.2rem; border-radius: 14px;
    border: 1px solid var(--stv-border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.stv-timeline .stv-tl-item::before {
    content: ""; position: absolute; left: -1.85rem; top: 1.1rem;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--stv-primary); border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--stv-primary);
}
.stv-timeline .stv-tl-time {
    font-weight: 700; color: var(--stv-primary-dark); font-size: .95rem;
}
.stv-timeline .stv-tl-title { font-weight: 700; margin: .15rem 0; }
.stv-timeline .stv-tl-desc { color: var(--stv-muted); font-size: .9rem; }
.stv-timeline .stv-tl-cost { font-size: .85rem; color: var(--stv-accent); font-weight: 600; }
.stv-timeline .stv-tl-img { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; }
.stv-locked {
    background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
    border: 1px dashed #fbbf24;
}
.stv-locked .bi-lock-fill { color: #f59e0b; }

/* ---------- CHAT WIDGET ---------- */
.stv-chat-fab {
    position: fixed; bottom: 24px; right: 24px;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--stv-primary) 0%, var(--stv-accent) 100%);
    color: #fff; border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
    z-index: 1050;
}
.stv-chat-fab:hover { transform: scale(1.05); }

.stv-chat-panel {
    position: fixed; bottom: 100px; right: 24px;
    width: 360px; max-width: 92vw; max-height: 70vh;
    background: #fff; border-radius: 18px;
    border: 1px solid var(--stv-border);
    box-shadow: var(--stv-shadow-lg);
    display: none; flex-direction: column; overflow: hidden;
    z-index: 1050;
}
.stv-chat-panel.open { display: flex; }
.stv-chat-header {
    background: linear-gradient(135deg, var(--stv-primary) 0%, var(--stv-primary-dark) 100%);
    color: #fff;
    padding: .9rem 1rem;
    font-weight: 700; display: flex; align-items: center; gap: .5rem;
}
.stv-chat-body {
    flex: 1; overflow-y: auto; padding: 1rem; background: #f8fafc;
    display: flex; flex-direction: column; gap: .5rem;
}
.stv-chat-msg { padding: .6rem .85rem; border-radius: 14px; max-width: 85%; line-height: 1.45; font-size: .92rem; white-space: pre-wrap; }
.stv-chat-msg.user { align-self: flex-end; background: var(--stv-primary); color: #fff; border-bottom-right-radius: 4px; }
.stv-chat-msg.bot  { align-self: flex-start; background: #fff; border: 1px solid var(--stv-border); border-bottom-left-radius: 4px; }
.stv-chat-foot { display: flex; padding: .55rem; gap: .4rem; border-top: 1px solid var(--stv-border); background: #fff; }
.stv-chat-foot input { flex: 1; border: 1px solid var(--stv-border); border-radius: 999px; padding: .55rem 1rem; outline: none; }
.stv-chat-foot button { border: 0; background: var(--stv-primary); color: #fff; border-radius: 999px; padding: 0 1rem; font-weight: 600; }

/* ---------- MAP CONTAINER ---------- */
.stv-map {
    width: 100%; height: 380px; border-radius: var(--stv-radius);
    border: 1px solid var(--stv-border); overflow: hidden; background: #e5e7eb;
}
.stv-map.tall { height: 520px; }

/* ---------- ADMIN ---------- */
.stv-stat {
    background: #fff;
    border-radius: var(--stv-radius);
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--stv-border);
    display: flex; align-items: center; gap: .9rem;
}
.stv-stat .stv-stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.3rem;
    background: linear-gradient(135deg, var(--stv-primary) 0%, var(--stv-accent) 100%);
}
.stv-stat .stv-stat-num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stv-stat .stv-stat-label { color: var(--stv-muted); font-size: .85rem; }

.stv-heat-bar {
    height: 12px; background: #e5e7eb; border-radius: 999px; overflow: hidden;
}
.stv-heat-bar > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--stv-primary), var(--stv-accent));
}

/* ---------- HERO SUBSCRIPTION ---------- */
.stv-pro-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    border-radius: var(--stv-radius);
    padding: 2rem;
    position: relative; overflow: hidden;
}
.stv-pro-card::after {
    content: "";
    position: absolute; right: -60px; top: -60px;
    width: 220px; height: 220px;
    background: radial-gradient(circle, var(--stv-accent), transparent 70%);
    opacity: .35;
}
.stv-pro-card .badge { background: var(--stv-accent); color: #1e293b; }

/* ---------- TRIP RESULT LAYOUT ---------- */
.stv-trip-result .row { align-items: flex-start; }
.stv-trip-result .stv-card { height: auto; }
.stv-trip-result .stv-trip-budget-sticky {
    position: sticky;
    top: 5.5rem;
    z-index: 2;
}

/* ---------- FOOTER ---------- */
main { padding-bottom: 5rem; }

.stv-footer {
    background: #0f172a; color: #cbd5e1;
    padding: 3rem 0 1.5rem;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}
.stv-footer h6 { color: #fff; font-weight: 700; margin-bottom: .8rem; }
.stv-footer a { color: #94a3b8; }
.stv-footer a:hover { color: #fff; }
.stv-footer .stv-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    margin-top: 1.5rem; padding-top: 1.2rem; font-size: .85rem; color: #64748b;
}

/* ---------- UTILITIES ---------- */
.stv-pill-tone {
    background: #ecfeff; color: var(--stv-primary-dark);
    padding: .25rem .65rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.stv-section.alt { background: #fff; }
.stv-divider {
    height: 1px; background: linear-gradient(90deg, transparent, var(--stv-border), transparent);
    margin: 2.5rem 0;
}
.stv-empty {
    background: #fff; border: 1px dashed var(--stv-border);
    border-radius: var(--stv-radius); padding: 2.5rem; text-align: center; color: var(--stv-muted);
}
.stv-pagination .pagination .page-link {
    border-radius: 8px; margin: 0 2px; color: var(--stv-primary-dark);
}
.stv-pagination .pagination .page-item.active .page-link {
    background: var(--stv-primary); border-color: var(--stv-primary);
}
.bi { vertical-align: -2px; }

@media (max-width: 768px) {
    .stv-hero { padding: 2.5rem 0 1.8rem; }
    .stv-hero .stv-search input { padding: .7rem 1rem; font-size: 1rem; }
    .stv-chat-panel { right: 12px; left: 12px; width: auto; max-height: 80vh; }
    .stv-chat-fab { right: 16px; bottom: 16px; }
}
