:root {
    --bg: #0b1220;
    --card-bg: #141c2f;
    --card-hover: #1c2640;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent: #00d2d3;
    --accent-glow: rgba(0, 210, 211, 0.3);
    --vingroup: #ff6b6b;
    --masan: #4ecdc4;
    --sovico: #ffe66d;
    --fpt: #ff9f43;
    --hoaphat: #54a0ff;
    --gelex: #a29bfe;
    --border: #2d3748;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Encode Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 210, 211, 0.4);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 210, 211, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 210, 211, 0);
    }
}

@keyframes drawCircle {
    from {
        stroke-dasharray: 0, 100;
    }

    to {
        stroke-dasharray: 31, 100;
    }
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeIn 0.8s ease-out;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(90deg, #ff6b6b, #ff9f43);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.25;
    margin-bottom: 20px;
    font-weight: 700;
}

.highlight-text {
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.hero-sapo {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Section Common */
.section {
    margin-bottom: 60px;
    animation: fadeIn 1s ease-out both;
    animation-timeline: view();
    animation-range: entry 20% cover 30%;
    /* Modern scroll animation */
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: -15px;
    margin-bottom: 30px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60%;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* Overview Section */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.donut-chart-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.donut-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.donut-bg {
    fill: none;
    stroke: #2d3748;
    stroke-width: 2.5;
}

.donut-segment {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    /* animation: drawCircle 1.5s ease-out forwards; Remove animation here to control via JS or keep simple */
}

.donut-text {
    fill: #fff;
    font-size: 0.5rem;
    font-weight: 700;
    text-anchor: middle;
    transform: rotate(90deg);
    /* Reset rotation for text */
    transform-origin: center;
}

.donut-label {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-card {
    text-align: center;
    margin-bottom: 20px;
}

.info-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.info-unit {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.info-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.info-text p {
    font-size: 1rem;
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    border-left: 3px solid var(--accent);
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.group-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.group-card:hover {
    background: var(--card-hover);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.group-card.active {
    background: var(--card-hover);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 210, 211, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.group-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.group-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-top: 8px;
}

.card-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.expand-icon {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.expand-icon::before,
.expand-icon::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 2px;
}

.expand-icon::before {
    width: 10px;
    height: 2px;
}

.expand-icon::after {
    width: 2px;
    height: 10px;
}

.group-card.active .expand-icon {
    transform: rotate(45deg);
    background: var(--accent);
}

.card-detail {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0;
}

.group-card.active .card-detail {
    max-height: 800px;
    opacity: 1;
    margin-top: 20px;
    padding-top: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.9rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stock-code {
    font-weight: 700;
    color: var(--accent);
}

.stock-val {
    color: #fff;
}

.insight-text {
    margin-top: 15px;
    font-size: 0.9rem;
    font-style: italic;
    color: #d1d5db;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
}

.power-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-bottom: 12px;
    margin-top: 5px;
    overflow: hidden;
    position: relative;
}

.power-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease-out;
}

.view-more-text {
    font-size: 0.75rem;
    color: #ffeb3b;
    /* Vàng sáng */
    margin-left: 10px;
    font-style: italic;
    opacity: 0.8;
    display: inline-block;
    vertical-align: middle;
}

.group-card.active .view-more-text {
    display: none;
}

/* Insights Section */
.insights-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.insight-item {
    display: flex;
    gap: 20px;
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    align-items: flex-start;
}

.insight-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #0b1220;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
}

.insight-content h3 {
    margin-bottom: 8px;
    color: #fff;
}

.insight-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Footer */
.footer-section {
    text-align: center;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

.footer-note {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: inline-block;
    text-align: left;
    max-width: 600px;
}

.credit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .donut-chart-wrapper {
        width: 140px;
        height: 140px;
    }

    .info-number {
        font-size: 3rem;
    }

    .insight-item {
        flex-direction: column;
        gap: 15px;
    }

    .app-container {
        padding: 15px;
    }
}