/* --- BIẾN MÀU SẮC & CẤU HÌNH CHUNG --- */
:root {
    --primary: #0056b3;       /* Xanh đậm uy tín */
    --primary-light: #e7f1ff; /* Xanh nhạt nền */
    --secondary: #00a8ff;     /* Xanh sáng năng động */
    --accent: #ffc107;        /* Vàng nổi bật */
    --dark: #2c3e50;          /* Đen xám hiện đại */
    --text-grey: #6c757d;
    --light: #f8f9fa;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 15px 30px rgba(0,0,0,0.12);
    --radius: 12px;
}

body { 
    font-family: 'Roboto', 'Segoe UI', sans-serif; 
    background-color: #f4f7f6; 
    color: var(--dark); 
    overflow-x: hidden; 
    line-height: 1.6;
}

/* --- THANH ĐIỀU HƯỚNG (NAVBAR) --- */
.top-bar { 
    background: linear-gradient(90deg, #004085, #0056b3); 
    color: rgba(255,255,255,0.9); 
    padding: 8px 0; 
    font-size: 0.85rem; 
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.top-bar a { color: white; transition: 0.2s; }
.top-bar a:hover { color: var(--accent); }

.navbar { 
    background: rgba(255, 255, 255, 0.98); 
    backdrop-filter: blur(10px); 
    box-shadow: var(--shadow-sm); 
    padding: 15px 0; 
    transition: all 0.3s ease;
}
.navbar-brand { 
    font-weight: 800; 
    color: var(--primary) !important; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-size: 1.4rem;
}
.nav-link { 
    font-weight: 600; 
    color: #444 !important; 
    margin: 0 10px; 
    position: relative;
    transition: 0.3s;
}
.nav-link:hover, .nav-link.active { color: var(--primary) !important; }
.nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary); transition: width 0.3s;
}
.nav-link:hover::after { width: 100%; }

/* --- HERO SECTION (BANNER) --- */
.hero-section {
    position: relative;
    background-size: cover; background-position: center; background-attachment: fixed;
    padding: 160px 0 120px; 
    color: white; 
    text-align: center; 
    border-radius: 0 0 50px 50px; /* Bo tròn góc dưới */
    margin-bottom: 30px;
    overflow: hidden;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(0, 45, 114, 0.85), rgba(0, 168, 255, 0.75));
    z-index: 1;
}
.hero-content { position: relative; z-index: 2; }
.hero-title { 
    font-size: 3.5rem; 
    font-weight: 900; 
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    letter-spacing: -1px;
}
.hero-btn { 
    background: var(--accent); 
    color: #000; 
    font-weight: 700; 
    padding: 14px 40px; 
    border-radius: 50px; 
    border: none; 
    transition: all 0.3s ease; 
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4); 
    text-transform: uppercase;
    font-size: 1rem;
}
.hero-btn:hover { 
    transform: translateY(-3px); 
    background: #ffca2c; 
    box-shadow: 0 10px 25px rgba(255, 193, 7, 0.6); 
}

/* --- HIỆU ỨNG TUYẾT RƠI (NÂNG CẤP) --- */
#snow-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999; overflow: hidden;
}
.snowflake {
    position: absolute; top: -50px; 
    color: #fff;
    user-select: none; pointer-events: none;
    will-change: transform;
    /* Mặc định là rơi và xoay nhẹ */
    animation: fall linear infinite;
    text-shadow: 0 0 5px rgba(255,255,255,0.8);
    font-size: 1.2rem;
}

/* Style riêng cho bông tuyết dạng ảnh */
.snowflake img {
    width: 100%; 
    height: 100%; 
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.5));
}

/* Keyframes rơi kết hợp lắc lư (Sway) - Tạo cảm giác rơi tự nhiên */
@keyframes fall {
    0% { 
        transform: translateY(0) translateX(0) rotate(0deg); 
        opacity: 0.9; 
    }
    25% {
        transform: translateY(25vh) translateX(15px) rotate(45deg); 
    }
    50% {
        transform: translateY(50vh) translateX(-15px) rotate(90deg); 
    }
    75% {
        transform: translateY(75vh) translateX(15px) rotate(135deg); 
    }
    100% { 
        transform: translateY(110vh) translateX(0) rotate(180deg); 
        opacity: 0; 
    }
}

/* --- DỊCH VỤ (SERVICE CARDS) --- */
.section-title {
    text-align: center; margin-bottom: 3rem;
}
.section-title h2 {
    font-weight: 800; color: var(--primary); text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 10px;
}
.section-divider {
    width: 60px; height: 4px; background: var(--accent); margin: 0 auto; border-radius: 2px;
}

.service-card { 
    border: none; 
    border-radius: var(--radius); 
    background: var(--white); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    overflow: hidden; 
    box-shadow: var(--shadow-sm); 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    position: relative;
}
.service-card:hover { 
    transform: translateY(-10px); 
    box-shadow: var(--shadow-lg); 
}
.service-img-wrapper { 
    height: 240px; overflow: hidden; position: relative; 
}
.service-img { 
    width: 100%; height: 100%; object-fit: cover; transition: 0.6s; 
}
.service-card:hover .service-img { transform: scale(1.1); }
.service-price { 
    position: absolute; bottom: 15px; right: 15px; 
    background: rgba(255,255,255,0.95); 
    color: var(--primary); 
    font-weight: 800; 
    padding: 8px 16px; 
    border-radius: 20px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}
.service-body { 
    padding: 25px; flex-grow: 1; display: flex; flex-direction: column; 
}
.service-body h4 { 
    font-weight: 700; margin-bottom: 10px; color: var(--dark); font-size: 1.25rem;
}
.service-meta {
    font-size: 0.9rem; color: #777; margin-bottom: 15px;
    display: flex; align-items: center; gap: 5px;
}

/* --- TÍNH NĂNG (FEATURES) --- */
.feature-box { 
    padding: 30px 20px; 
    background: var(--white); 
    border-radius: var(--radius); 
    text-align: center; 
    box-shadow: var(--shadow-sm); 
    transition: 0.3s; 
    height: 100%; 
    border: 1px solid #eee;
}
.feature-box:hover { 
    transform: translateY(-5px); 
    box-shadow: var(--shadow-md); 
    border-color: var(--primary-light);
}
.feature-icon { 
    font-size: 2.2rem; 
    color: var(--white); 
    margin-bottom: 20px; 
    background: linear-gradient(135deg, var(--secondary), var(--primary)); 
    width: 70px; height: 70px; 
    line-height: 70px; 
    border-radius: 50%; 
    display: inline-block; 
    box-shadow: 0 5px 15px rgba(0, 86, 179, 0.3);
}
.feature-box h5 { font-weight: 700; margin-bottom: 10px; }

/* --- CÔNG CỤ (TOOLS) --- */
.tool-card {
    border: none; border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: 0.3s;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.tool-header {
    padding: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: white; display: flex; align-items: center; gap: 10px;
}
.tool-header.primary { background: linear-gradient(45deg, #007bff, #0056b3); }
.tool-header.danger { background: linear-gradient(45deg, #dc3545, #b02a37); }

/* --- THỐNG KÊ (STATISTICS - REDESIGNED) --- */
.stats-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}
.stat-card-modern {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05); /* Tăng độ đậm viền lên chút để dễ thấy trên mobile */
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}
.stat-card-modern:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 86, 179, 0.1);
}
.stat-card-modern:hover::before {
    transform: scaleX(1);
}
.stat-icon-wrapper {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 15px;
    transition: transform 0.3s ease;
}
.stat-card-modern:hover .stat-icon-wrapper {
    transform: scale(1.1) rotate(10deg);
}
/* Màu sắc riêng cho từng thẻ thống kê */
.stat-online .stat-icon-wrapper { background-color: rgba(40, 167, 69, 0.1); color: #28a745; }
.stat-today .stat-icon-wrapper { background-color: rgba(255, 193, 7, 0.1); color: #ffc107; }
.stat-month .stat-icon-wrapper { background-color: rgba(23, 162, 184, 0.1); color: #17a2b8; }
.stat-total .stat-icon-wrapper { background-color: rgba(0, 123, 255, 0.1); color: #007bff; }

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 5px;
    word-break: break-all; /* Ngăn số dài làm vỡ layout */
}
.stat-label {
    color: var(--text-grey);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- FOOTER --- */
footer { 
    background: #1a1a1a; 
    color: #aaa; 
    padding-top: 70px; 
    font-size: 0.95rem; 
}
footer h4 { 
    color: var(--white); 
    margin-bottom: 25px; 
    font-weight: 700; 
    text-transform: uppercase; 
    border-left: 4px solid var(--accent);
    padding-left: 15px;
}
footer .list-unstyled li { margin-bottom: 12px; }
footer .text-white-50 { color: rgba(255,255,255,0.5) !important; }

/* --- MODAL --- */
.modal-content { border-radius: 16px; border: none; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.2); }
.modal-header { padding: 20px 25px; }
.modal-body { padding: 25px; }

/* --- TYPING EFFECT CURSOR --- */
.typing-cursor {
    display: inline-block;
    width: 3px;
    background-color: #fff; /* Màu trắng cho nổi trên nền hero */
    animation: blink-cursor 0.75s step-end infinite;
    margin-left: 5px;
    vertical-align: text-bottom;
    height: 1.2em;
}

@keyframes blink-cursor {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* --- IN-APP BROWSER OVERLAY --- */
#inapp-browser-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px;
}
.inapp-arrow-container {
    position: absolute; top: 15px; right: 20px;
    text-align: center; color: white;
    animation: bounce-diagonal 1.5s infinite;
}
.inapp-arrow-container i { font-size: 3rem; color: #fff; filter: drop-shadow(0 0 10px var(--accent)); }
.inapp-arrow-text { font-size: 0.9rem; font-weight: bold; background: var(--accent); color: #000; padding: 2px 8px; border-radius: 4px; margin-top: 5px; display: block; }

@keyframes bounce-diagonal {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-10px, 10px); }
}

.inapp-card {
    background: white; border-radius: 20px; padding: 30px;
    max-width: 400px; width: 100%; text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative; animation: fade-up 0.5s ease-out;
}
.inapp-card h3 { color: var(--primary); font-weight: 800; margin-bottom: 10px; text-transform: uppercase; }
.inapp-card p { color: #555; margin-bottom: 25px; }
.inapp-steps { text-align: left; background: #f8f9fa; padding: 15px; border-radius: 10px; margin-bottom: 20px; }
.inapp-step { display: flex; align-items: center; margin-bottom: 12px; font-size: 0.95rem; }
.inapp-step:last-child { margin-bottom: 0; }
.inapp-step-icon { 
    width: 30px; height: 30px; background: var(--primary-light); color: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: bold; margin-right: 15px; flex-shrink: 0;
}

@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   RESPONSIVE CHO MOBILE (KHẮC PHỤC LỖI THỐNG KÊ BỊ CHE/TRÀN)
   ========================================================================== */
@media (max-width: 768px) {
    /* Điều chỉnh tiêu đề Banner */
    .hero-title { font-size: 2.2rem; }
    .hero-section { padding: 120px 0 80px; border-radius: 0 0 30px 30px; }
    
    /* Điều chỉnh thẻ Thống Kê cho Mobile */
    .stats-section .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Giảm kích thước thẻ để vừa màn hình nhỏ */
    .stat-card-modern {
        padding: 15px 10px; /* Padding trên/dưới 15px, trái/phải 10px */
        min-height: 130px; /* Chiều cao tối thiểu nhỏ hơn */
        border-radius: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05); /* Bóng đổ nhẹ hơn */
    }

    /* Thu nhỏ icon */
    .stat-icon-wrapper {
        width: 45px; height: 45px;
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    /* Thu nhỏ số liệu */
    .stat-number {
        font-size: 1.4rem !important; /* Dùng !important để ghi đè */
        margin-bottom: 2px;
    }

    /* Thu nhỏ nhãn chữ */
    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    /* Điều chỉnh khoảng cách Grid */
    .row.g-4 {
        --bs-gutter-x: 0.8rem; /* Giảm khoảng cách ngang giữa các thẻ */
        --bs-gutter-y: 0.8rem; /* Giảm khoảng cách dọc */
    }
    
    .feature-box { padding: 20px; }
    .inapp-arrow-container { top: 10px; right: 10px; }
}

/* --- THÊM PHẦN HIỆU ỨNG SLIDER --- */
/* Ken Burns Effect (Zoom chậm) */
.kenburns-effect {
    animation: kenburns 20s infinite alternate;
}

@keyframes kenburns {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.15); /* Zoom lên 115% */
    }
}

/* Đổ bóng chữ để nổi bật trên nền ảnh */
.text-shadow {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

/* Caption của Slider */
.carousel-caption {
    bottom: 30%; /* Đẩy lên cao hơn chút */
    z-index: 20;
}

.carousel-caption p {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.3); /* Nền mờ nhẹ giúp chữ dễ đọc */
    display: inline-block;
    padding: 5px 15px;
    border-radius: 50px;
    backdrop-filter: blur(2px);
}

/* Tùy chỉnh nút chuyển slide */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    background-size: 50%, 50%;
}

/* Ẩn nút chuyển slide trên mobile để đỡ rối */
@media (max-width: 768px) {
    .carousel-control-prev, .carousel-control-next {
        display: none;
    }
    .carousel-caption p {
        font-size: 1rem;
        padding: 3px 10px;
    }
}