@import url('https://fonts.googleapis.com/css2?family=Encode+Sans:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary-color: #E31B21;
    --secondary-color: #0b3c6d;
    --bg-color: #F8F9FA;
    --text-color: #2D3436;
    --white: #ffffff;
    --gray-light: #F1F2F6;
    --accent-color: #00A8FF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Encode Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 500px;
    background: url('davos.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 24px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 2px 4px 20px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Conclusion */
.conclusion-container {
    max-width: 800px;
    margin: 60px auto 100px;
    padding: 0 24px;
}

.conclusion-text {
    font-size: 18px;
    font-weight: 500;
    color: var(--secondary-color);
    text-align: center;
    line-height: 1.8;
    padding: 30px;
    background: var(--gray-light);
    border-radius: 16px;
    border-left: 5px solid var(--primary-color);
}

/* Sapo */
.sapo-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
}

.sapo {
    font-size: 18px;
    font-weight: 400;
    color: #4A4A4A;
    text-align: center;
    line-height: 1.7;
    position: relative;
}

.sapo::before {
    content: '"';
    font-size: 60px;
    color: var(--primary-color);
    position: absolute;
    top: -30px;
    left: -20px;
    opacity: 0.1;
    font-family: serif;
}

/* Grid Layout */
.grid-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

/* Card Style */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px 24px 44px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-light);
    position: relative;
}

.card::after {
    content: "Bấm để xem chi tiết";
    position: absolute;
    bottom: 18px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
}

.card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.card-number {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-light);
    border-radius: 16px;
    transition: background 0.3s;
}

.card:hover .card-icon {
    background: var(--primary-color);
}

.card-icon svg {
    width: 32px;
    height: 32px;
    fill: var(--secondary-color);
    transition: fill 0.3s;
}

.card:hover .card-icon svg {
    fill: var(--white);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.4;
    text-transform: uppercase;
}

/* Detail Box (Overlay/Modal) */
/* Detail Box (Overlay/Modal) */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 60, 109, 0.9);
    display: none;
    /* Controlled by JS */
    z-index: 1000;
    padding: 20px 0;
    align-items: flex-start;
    justify-content: center;
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.detail-box {
    background: var(--white);
    max-width: 650px;
    width: 100%;
    /* Remove limit on max-height */
    max-height: none;
    border-radius: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: zoomIn 0.3s ease-out;
    margin: auto 16px;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.detail-header {
    padding: 32px 32px 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.detail-header-text {
    flex: 1;
}

.detail-point-number {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.detail-header h3 {
    font-size: 24px;
    color: var(--secondary-color);
    line-height: 1.3;
}

.close-detail {
    width: 36px;
    height: 36px;
    background: var(--gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 20px;
}

.close-detail:hover {
    background: var(--primary-color);
    color: var(--white);
}

.detail-body {
    padding: 24px 32px 40px;
    overflow-y: visible;
    flex: none;
}

/* Scrollbar styling for Chrome/Safari - Removed from detail-body, applied to overlay if needed, or default */
.detail-overlay::-webkit-scrollbar {
    width: 6px;
}

.detail-overlay::-webkit-scrollbar-track {
    background: var(--gray-light);
}

.detail-overlay::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.detail-body p {
    font-size: 16px;
    margin-bottom: 16px;
    color: #444;
    line-height: 1.7;
    text-align: justify;
}

.detail-body p:last-child {
    margin-bottom: 0;
}

/* Mini Illustration in Detail */
/* Mini Illustration in Detail */
.mini-illustration {
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    margin: 0;
    padding: 0;
    background: transparent;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(0deg);
}

.mini-illustration svg {
    width: 100%;
    height: 100%;
    fill: var(--primary-color);
    max-width: none;
}

.detail-box {
    background: var(--white);
    max-width: 650px;
    width: 100%;
    /* Remove limit on max-height */
    max-height: none;
    border-radius: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: zoomIn 0.3s ease-out;
    margin: auto 16px;
    overflow: hidden;
}

.detail-header,
.detail-body {
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        height: 400px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .grid-container .card:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }

    .detail-box {
        max-height: none;
    }

    .detail-header {
        padding: 24px;
    }

    .detail-body {
        padding: 20px 24px 32px;
    }

    .detail-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .grid-container .card:last-child {
        max-width: 100%;
    }
}

/* Modal Navigation */
.detail-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 32px 32px;
    border-top: 1px solid var(--gray-light);
    margin-top: auto;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.nav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
    max-width: 48%;
}

.nav-btn:hover {
    background: var(--gray-light);
    border-color: #e0e0e0;
}

.nav-prev {
    text-align: left;
}

.nav-next {
    text-align: right;
    justify-content: flex-end;
}

.nav-content {
    display: flex;
    flex-direction: column;
    margin: 0 12px;
    overflow: hidden;
}

.nav-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 4px;
}

.nav-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
    line-height: 1.4;
}

.nav-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    fill: var(--secondary-color);
    opacity: 1;
    transition: all 0.3s;
}

.nav-btn:hover .nav-icon {
    fill: var(--primary-color);
    opacity: 1;
}

.nav-arrow {
    font-size: 18px;
    color: var(--primary-color);
    font-weight: bold;
}