/* Base Settings */
body {
    background-color: #fafafa;
    color: #111827;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: hidden; /* Khóa cuộn trang khi ở màn hình Hero */
    font-family: Arial, Helvetica, sans-serif;
}

h1, h2, h3, h4, .ui-text {
    font-family: Arial, Helvetica, sans-serif;
}

/* Hero Section (New 2D Timeline) */
#hero-container {
    position: fixed; 
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    transition: opacity 0.8s ease-in-out;
}

.bg-grid-dots {
    background-color: #ffffff; /* Đổi nền thành trắng */
    background-image: radial-gradient(rgba(0, 0, 0, 0.15) 1px, transparent 1px); /* Chấm bi đen mờ */
    background-size: 24px 24px;
}

.timeline-col {
    transition: all 0.5s ease;
}

.timeline-col.active {
    opacity: 1;
}

.timeline-col.inactive {
    opacity: 0.25;
}

/* 4 Màu nền đặc trưng cho 4 cột mốc thời gian */
.timeline-col.active.bg-stage-0 { background-color: #050505; }
.timeline-col.active.bg-stage-1 { background-color: #334155; }
.timeline-col.active.bg-stage-2 { background-color: #0f766e; }
.timeline-col.active.bg-stage-3 { background-color: #dc2626; } /* Đổi màu xanh thành đỏ */

/* Xử lý màu chữ động: Đen/xám khi nền trắng, Trắng khi có màu nền */
.timeline-col h2 { color: #111827; transition: color 0.5s ease; }
.timeline-col h2 span { color: #6b7280; transition: color 0.5s ease; }
.timeline-col p { color: #4b5563; transition: color 0.5s ease; }

.timeline-col.active h2, .timeline-col.active h2 span, .timeline-col.active p { color: #ffffff; }

.car-img {
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-out;
}

/* CSS Filter ma thuật để bóc tách nền trắng thuần mà KHÔNG làm thủng màu sơn xe trắng. Đã xóa bỏ drop-shadow để triệt tiêu khung viền đen và sử dụng feComposite để vá viền trong suốt */
.smart-remove-bg {
    filter: url(#remove-pure-white);
}

/* Navigation Action */
.action-container {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    z-index: 50;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.btn-next-3d {
    background-color: #ef4444;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 40px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
}

.btn-next-3d:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.btn-prev-3d {
    background-color: #111;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 30px;
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
    display: none; /* Ẩn ở bước đầu tiên */
}

.btn-prev-3d:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: #ffffff;
}

#main-article {
    display: none; /* Ẩn bài viết ban đầu */
}

/* Article Typography */
.article-body {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 20px;
    font-size: 1.15rem;
    color: #374151;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.article-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Đảm bảo Dropcap chỉ áp dụng cho đoạn văn đầu tiên của bài viết */
.article-body > p:first-of-type::first-letter {
    font-size: 4rem;
    line-height: 0.8;
    float: left;
    margin-right: 12px;
    margin-top: 8px;
    font-weight: 900;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
}

.article-body figure {
    margin: 2.5rem 0;
    width: 100%;
}
.article-body figure img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.article-body figcaption {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.75rem;
    text-align: center;
}

/* Dark Dashboard */
.dark-dashboard {
    background-color: #0f172a; /* Slate 900 */
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    font-family: Arial, Helvetica, sans-serif;
    margin-bottom: 3rem;
}

/* Car Slider */
input[type=range].car-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin: 20px 0;
}
input[type=range].car-slider:focus { outline: none; }
input[type=range].car-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #334155; 
    border-radius: 2px;
}
input[type=range].car-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 28px;
    width: 28px;
    background-color: transparent;
    /* Car Icon for dark bg */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffffff"><path d="M18.92 6.01C18.72 5.42 18.16 5 17.5 5H6.5c-.66 0-1.22.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.85 7h10.29l1.04 3H5.81l1.04-3zM19 17H5v-4.66l.12-.34h13.76l.12.34V17z"/><circle cx="7.5" cy="14.5" r="2"/><circle cx="16.5" cy="14.5" r="2"/></svg>');
    background-size: 24px;
    background-position: center;
    background-repeat: no-repeat;
    margin-top: -12px;
    cursor: pointer;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.4));
    transition: transform 0.1s;
}
input[type=range].car-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Factory Grid */
.factory-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85rem;
    color: #4b5563;
}
.legend-item { display: flex; align-items: center; gap: 6px;}
.legend-color { width: 12px; height: 12px; border-radius: 3px; }

.factory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    font-family: Arial, Helvetica, sans-serif;
    margin-bottom: 2rem;
}
.factory-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    border-left: 4px solid #9ca3af; /* Default Gray */
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}
.factory-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.factory-card.blue { border-left-color: #2563eb; background: #f0f9ff; }
.factory-card.green { border-left-color: #10b981; background: #f0fdf4; }
.factory-card.red { border-left-color: #ef4444; background: #fef2f2; }

.f-year { font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; }
.factory-card.blue .f-year { color: #1d4ed8; }
.factory-card.green .f-year { color: #047857; }
.factory-card.red .f-year { color: #b91c1c; }
.factory-card:not(.blue):not(.green):not(.red) .f-year { color: #374151; }

.f-name { font-weight: 700; color: #111827; font-size: 0.95rem; line-height: 1.3;}
.f-loc { font-size: 0.8rem; color: #6b7280; margin-top: 4px; }