/* ===== BIẾN MÀU & THIẾT LẬP CHUNG ===== */
:root {
    --primary-red: #c8102e;
    --dark-red: #8b0000;
    --text-main: #333333;
    --text-muted: #555555;
    --bg-main: #ffffff;
    --bg-light: #f8f9fa;
    --font-size: 19px;
    --transition: 0.3s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: var(--font-size);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Ẩn các class hỗ trợ */
.hidden { display: none !important; }

/* Background SCGs */
.bg-svg {
    position: fixed;
    z-index: -1;
    top: 50%;
    transform: translateY(-50%);
    width: 150vw;
    left: -25vw;
    opacity: 0.05;
    pointer-events: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== MỞ ĐẦU (HERO) ===== */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.title-main {
    font-size: 2.5em;
    font-weight: 900;
    color: var(--primary-red);
    line-height: 1.2;
    margin-bottom: 20px;
}

.sub-hero {
    font-size: 1.25em;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 40px;
}

.hero-illustration svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto;
}

/* ===== KHỐI THÔNG TIN NHANH ===== */
.section-title {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-red);
    margin: 40px 0 20px;
    border-bottom: 3px solid var(--primary-red);
    display: inline-block;
    padding-bottom: 5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(200,16,46,0.15);
}

.stat-icon svg {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 2em;
    font-weight: 900;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.stat-text {
    font-size: 1em;
    color: var(--text-muted);
    font-weight: 500;
}

/* Biểu đồ Donut */
.chart-container {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    text-align: center;
}

.chart-title {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #333;
}

.donut-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.donut-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.donut-segment {
    fill: transparent;
    stroke-width: 4;
    transition: stroke-dasharray 1s ease-out;
}

.segment-1 { stroke: var(--primary-red); }
.segment-2 { stroke: #e67e22; }
.segment-3 { stroke: #dcdde1; }

.donut-text {
    font-size: 4px;
    font-weight: bold;
    fill: var(--text-main);
    text-anchor: middle;
}

.donut-legend {
    text-align: left;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 10px;
    display: inline-block;
}

.color-1 { background-color: var(--primary-red); }
.color-2 { background-color: #e67e22; }
.color-3 { background-color: #dcdde1; }

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    max-width: 600px;
    margin: 0 auto 40px;
    padding-left: 30px;
    border-left: 4px solid #e0e0e0;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -41px;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #fff;
    border: 4px solid #e0e0e0;
    transition: var(--transition);
}

.timeline-item.active .timeline-dot {
    border-color: var(--primary-red);
    background-color: var(--primary-red);
    box-shadow: 0 0 0 4px rgba(200,16,46,0.2);
}

.timeline-content {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.timeline-content h3 {
    margin-bottom: 10px;
    color: var(--primary-red);
}

/* ===== SO SÁNH ===== */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.plan-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.plan-header {
    padding: 15px;
    text-align: center;
    font-weight: 700;
    color: #fff;
    font-size: 1.2em;
}

.bg-red { background: var(--primary-red); }
.bg-dark { background: #2c3e50; }

.plan-content {
    padding: 25px;
}

.plan-content h4 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.plan-content ul {
    list-style-position: inside;
    margin-bottom: 20px;
}

.plan-content li {
    margin-bottom: 10px;
}

/* ===== NÚT BẤM ===== */
.btn-modal, .btn-calculate {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background-color: var(--primary-red);
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-modal:hover, .btn-calculate:hover {
    background-color: var(--dark-red);
}

/* ===== CALCULATOR ===== */
.calculator-card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    outline: none;
    transition: border 0.3s;
}

.input-group input:focus {
    border-color: var(--primary-red);
}

.results-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.result-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #eee;
    transition: var(--transition);
}

.result-box.highlight {
    border-color: var(--primary-red);
    box-shadow: 0 4px 15px rgba(200,16,46,0.15);
    position: relative;
}

.result-box.highlight::after {
    content: "Có Lợi Hơn";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-red);
    color: #fff;
    padding: 2px 10px;
    font-size: 0.7em;
    border-radius: 10px;
    font-weight: bold;
}

.result-value {
    font-size: 1.5em;
    font-weight: 900;
    color: var(--primary-red);
    margin: 10px 0;
}

.result-note {
    font-size: 0.9em;
    color: var(--text-muted);
}

.conclusion {
    margin-top: 20px;
    padding: 15px;
    background: #eafaf1;
    color: #27ae60;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* ===== INSIGHT ===== */
.insight-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.insight-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    border-top: 4px solid var(--primary-red);
}

.insight-icon {
    font-size: 2em;
    margin-bottom: 15px;
}

.insight-card h3 {
    margin-bottom: 15px;
    color: var(--primary-red);
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

/* ===== ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
    .stats-grid, .comparison-grid, .results-container, .insight-cards {
        grid-template-columns: 1fr;
    }
    
    .title-main {
        font-size: 2em;
    }

    .donut-wrapper {
        flex-direction: column;
        gap: 20px;
    }
}
