:root {
    --primary: #1a56a8;
    --primary-light: #2c75d6;
    --accent: #ff6b35;
    --accent-light: #ff8552;
    --bg-color: #f5f6f8;
    --surface: #ffffff;
    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --border: #eef0f3;
    --success: #34c759;
    --warning: #ffcc00;
    --danger: #ff3b30;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --nav-height: 65px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font-main);
    background-color: #e5e5ea;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#mobile-container {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    background-color: var(--bg-color);
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

#app-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: var(--nav-height);
    background-color: var(--bg-color);
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; margin-bottom: 0.5rem; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ==================== Bottom Navigation ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: var(--nav-height);
    background-color: var(--surface);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 500;
    width: 60px;
    height: 100%;
    transition: color 0.2s;
    cursor: pointer;
}
.nav-item i { font-size: 1.25rem; margin-bottom: 4px; }
.nav-item.active { color: var(--primary); }

/* ==================== App Header ==================== */
.app-header {
    background-color: var(--surface);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.app-header.primary-header {
    background-color: var(--primary);
    color: white;
}
.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
}
.header-btn {
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.1rem;
    cursor: pointer;
}

/* ==================== Home Header ==================== */
.home-header {
    background-color: var(--primary);
    padding: 16px 16px 30px;
    border-radius: 0 0 24px 24px;
    color: white;
    position: relative;
    z-index: 10;
}
.home-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.loctn-title { font-size: 1.25rem; font-weight: 600; }

.search-bar {
    background: white;
    border-radius: 20px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.search-bar i { color: var(--text-secondary); margin-right: 12px; }
.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    font-family: inherit;
    background: transparent;
}

/* ==================== Pills ==================== */
.pills-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 16px;
    scrollbar-width: none;
}
.pills-container::-webkit-scrollbar { display: none; }
.pill {
    padding: 6px 16px;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.pill.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==================== Categories Grid ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px 4px;
    padding: 16px 10px;
    background: var(--surface);
    margin-bottom: 8px;
}
.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.category-item:active { transform: scale(0.95); }
.cat-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    transition: all 0.2s;
}
.cat-item-text { font-size: 0.65rem; font-weight: 500; text-align: center; }

/* ==================== Banners ==================== */
.banner-container {
    padding: 16px;
    background: var(--surface);
    margin-bottom: 8px;
}
.banner {
    height: 90px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}
.banner:active { transform: scale(0.98); }
.banner:last-child { margin-bottom: 0; }
.banner::before {
    content: '';
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: linear-gradient(to right, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
    z-index: 1;
}
.banner span { position: relative; z-index: 2; }

/* ==================== Homestay Cards ==================== */
.section-title { padding: 16px 16px 8px; font-size: 1.1rem; font-weight: 700; }
.homestay-list {
    padding: 0 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.homestay-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.homestay-card:active { transform: scale(0.98); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.h-card-img {
    height: 180px;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    position: relative;
}
.h-card-fav {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s;
}
.h-card-fav:active { transform: scale(1.2); }
.h-card-content { padding: 16px; }
.h-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}
.h-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.h-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--warning);
}
.h-location {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.h-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.h-tag {
    padding: 4px 8px;
    background: #f0f4f8;
    color: var(--primary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
.h-card-footer { display: flex; align-items: center; }
.h-price {
    background: var(--accent);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 10px;
}
.h-price-suffix { font-size: 0.8rem; color: var(--text-secondary); }

/* ==================== Detail Page ==================== */
.detail-hero {
    height: 280px;
    position: relative;
    background-size: cover;
    background-position: center;
}
.back-btn-float {
    position: absolute;
    top: 16px; left: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: background 0.2s;
}
.back-btn-float:hover { background: rgba(0,0,0,0.5); }
.gallery-btn-float {
    position: absolute;
    bottom: 16px; right: 16px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(0,0,0,0.5);
    color: white;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 6px;
}
.detail-content {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    margin-top: -20px;
    position: relative;
    padding: 24px 16px 100px;
}
.d-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}
.d-price { color: var(--accent); font-size: 1.25rem; font-weight: 700; }
.d-actions { display: flex; gap: 12px; }
.btn-icon-circular {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon-circular:hover { background: var(--primary); color: white; }

.d-cta-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
}
.btn {
    padding: 12px 8px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    color: white;
    transition: opacity 0.2s, transform 0.2s;
    font-family: inherit;
}
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn-primary { background: var(--accent); }
.btn-secondary { background: #00a48b; }
.btn-zalo { background: #0068ff; }

.d-amenities {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.amenity-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-primary);
}
.amenity-item i { font-size: 1.2rem; color: var(--text-secondary); }

.review-item { display: flex; gap: 12px; margin-bottom: 16px; }
.review-content p { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

/* ==================== Map Page ==================== */
#map-container {
    height: calc(100vh - 60px - var(--nav-height));
    width: 100%;
}
.map-filters {
    position: absolute;
    top: 70px;
    left: 10px; right: 10px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.map-filter-btn {
    background: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.map-filter-btn:active { background: #f0f0f0; }

/* Price Marker */
.price-marker {
    background: var(--accent);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    white-space: nowrap;
}
.price-marker::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: var(--accent) transparent transparent transparent;
}
.custom-price-marker {
    background: transparent !important;
    border: none !important;
}

/* Map Bottom Card */
.map-bottom-card {
    position: absolute;
    bottom: 10px;
    left: 10px; right: 10px;
    z-index: 1000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.map-card-inner {
    display: flex;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
}
.map-card-img {
    width: 90px; height: 70px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.map-card-info { flex: 1; }

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 430px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}
.modal-header h3 { margin-bottom: 0; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
}
.modal-body { padding: 20px; }

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 168, 0.1);
}
.form-group textarea { resize: vertical; }

/* Checkbox Pills */
.checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f0f4f8;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.checkbox-pill input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
}
.checkbox-pill:has(input:checked) {
    background: var(--primary);
    color: white;
}

/* ==================== Profile Menu ==================== */
.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.profile-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    cursor: pointer;
    transition: background 0.2s;
}
.profile-menu-item:active { background: #f8f9fa; }
.pmi-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pmi-left i { width: 24px; text-align: center; font-size: 1.1rem; }
.pmi-left span { font-size: 0.95rem; font-weight: 500; }
.pmi-right { display: flex; align-items: center; gap: 8px; }
.pmi-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}
.pmi-right > i { color: var(--text-secondary); font-size: 0.8rem; }

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== Utility ==================== */
.hidden { display: none !important; }

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==================== Scrollbar ==================== */
#app-content::-webkit-scrollbar { width: 0; }
#app-content { scrollbar-width: none; }
