/* ==========================================================================
   1. CORE & VARIABLES (Cấu hình chung)
   ========================================================================== */
:root {
    /* Bảng màu chuẩn chuyên nghiệp */
    --primary: #1A73E8;       /* Xanh dương Google - Dùng cho tiêu đề, link */
    --primary-dark: #1557b0;  /* Xanh dương đậm - Dùng cho hover */
    --secondary: #00C853;     /* Xanh lá - Dùng cho Giá tiền, Nút Mua */
    --secondary-hover: #009624;
    --accent: #FFD600;        /* Vàng - Dùng cho ngôi sao đánh giá */
    
    /* Màu nền và chữ */
    --bg-body: #F4F6F8;       /* Xám rất nhạt làm nền web */
    --bg-white: #FFFFFF;      /* Trắng làm nền thẻ */
    --text-main: #333333;     /* Chữ chính */
    --text-sub: #666666;      /* Chữ phụ (mô tả) */
    --border: #DEE2E6;        /* Màu đường viền */
    
    --container-width: 1200px;
    --font-stack: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 15px;
}

.container {
    width: 95%;
    max-width: var(--container-width);
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
.header {
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav a {
    font-weight: 600;
    color: var(--text-main);
}
.nav a:hover, .nav a.active {
    color: var(--primary);
}

.cta-button {
    background-color: var(--primary);
    color: white !important;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
}
.cta-button:hover {
    background-color: var(--primary-dark);
}

/* ==========================================================================
   3. HERO SECTION (Tìm kiếm trên trang chủ)
   ========================================================================== */
.hero-section {
    background-color: var(--bg-white);
    text-align: center;
    padding: 60px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.hero-section h2 {
    font-size: 32px;
    color: var(--text-main);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-sub);
    margin-bottom: 30px;
}

.quick-search-widget {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    display: inline-flex;
    gap: 10px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    justify-content: center;
}

.quick-search-widget select {
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    min-width: 180px;
    outline: none;
}

.main-cta-button {
    background-color: var(--secondary);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
}
.main-cta-button:hover {
    background-color: var(--secondary-hover);
}

/* ==========================================================================
   4. FILTER CARD (Bộ lọc ngang trang compare)
   ========================================================================== */
.filter-card {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    margin-bottom: 30px;
    border: 1px solid var(--border);
}

.filter-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    display: inline-block;
}

.filter-form {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 5px;
}

.filter-item select, 
.filter-item input {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 160px;
    font-size: 14px;
}

/* Style cho Checkbox tính năng */
.features-wrap {
    flex-grow: 1;
}
.tags-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.tag-check {
    cursor: pointer;
}
.tag-check input {
    display: none;
}
.tag-check span {
    display: block;
    padding: 8px 12px;
    background: #f0f2f5;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-sub);
    border: 1px solid transparent;
    transition: 0.2s;
}
.tag-check input:checked + span {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.btn-filter {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 25px;
    height: 42px; /* Khớp chiều cao input */
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}
.btn-filter:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   5. VPS GRID SYSTEM (GIAO DIỆN THẺ - KHẮC PHỤC LỖI VỠ HÌNH)
   ========================================================================== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Grid Layout: Tự động chia cột */
.vps-grid {
    display: grid;
    /* Tự động xếp: tối thiểu 350px mỗi thẻ, màn hình nhỏ thì 1 cột, lớn thì 2-3 cột */
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
}

/* Card Style */
.vps-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.vps-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

/* Card Header: Logo, Tên NCC, Giá */
.card-top {
    padding: 20px;
    border-bottom: 1px dashed var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFAFA;
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.provider-info img {
    height: 40px;
    width: 40px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px;
}
.provider-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-sub);
}
.rating {
    font-size: 12px;
    color: var(--accent);
    font-weight: bold;
}

.plan-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
    text-align: right;
    line-height: 1.2;
}
.plan-price small {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: normal;
    display: block;
}

/* Card Body: Tên Gói & Thông số */
.plan-name {
    padding: 20px 20px 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.card-specs {
    padding: 10px 20px 20px;
    flex-grow: 1; /* Đẩy nút mua xuống đáy */
}

.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.spec-row:last-child {
    border-bottom: none;
}

.spec-icon {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}
.spec-label {
    color: var(--text-sub);
}
.spec-value {
    font-weight: 600;
    color: var(--text-main);
}
/* In đậm thông số quan trọng (thay thế cho **) */
.spec-value strong {
    color: var(--primary);
    font-weight: 700;
}

/* Card Footer: Nút mua */
.card-action {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn-buy {
    display: block;
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px solid var(--secondary);
    color: var(--secondary);
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
}
.btn-buy:hover {
    background: var(--secondary);
    color: white;
}

/* Trạng thái không có kết quả */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 8px;
    color: var(--text-sub);
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.footer {
    background-color: #263238;
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 50px;
}

/* ==========================================================================
   7. RESPONSIVE (Di động)
   ========================================================================== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    .nav {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quick-search-widget {
        flex-direction: column;
        width: 100%;
    }
    .quick-search-widget select, 
    .quick-search-widget button {
        width: 100%;
    }
    
    .vps-grid {
        grid-template-columns: 1fr; /* 1 cột trên mobile */
    }
}