:root {
    --primary: #2A4B7C;
    --secondary: #f1f3ff;
    --muted: #4a5877;
    --radius: 8px;
    font-family: 'Exo', sans-serif;
}

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

body {
    background: var(--secondary);
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
}

main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Footer style - full width bottom of screen */
.footer-fixed {
    width: 100vw;
    /* full screen width */
    text-align: center;
    padding: 14px 0;
    font-size: 14px;
    color: var(--secondary);
    background: var(--primary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    margin-top: auto;
}

h1 {
    color: var(--primary);
    margin-bottom: 20px;
}

button,
input {
    font-family: inherit;
}


.btn {
    background: linear-gradient(90deg, #2A4B7C, #496BB8);
    color: #fff;
    padding: 12px 26px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(42, 75, 124, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(42, 75, 124, 0.35);
}

/* Hiệu ứng khi click */
@keyframes pulseButton {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(42, 75, 124, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(42, 75, 124, 0.4); }
}

.btn:active {
    animation: pulseButton 0.5s ease;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 20px;
    width: 90%;
    max-width: 900px;
    margin: 20px auto;
}

#page-container {
    width: 100%;
}

/* Upload Section */
.upload-container {
    text-align: center;
}

.upload-box {
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-box:hover {
    background: rgba(42, 75, 124, 0.02);
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.file-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#cvFile {
    display: none;
}

#file-name {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

/* Loading */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result Page */
.result-section {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    overflow: hidden;
}

.section-header {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-toggle {
    cursor: pointer;
    transition: background 0.3s ease;
}

.section-toggle:hover {
    background: linear-gradient(90deg, var(--primary), #496BB8);
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    color: #fff;
}

.section-toggle.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-body {
    padding: 16px;
    color: #333;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    opacity: 1;
}

.section-body.hidden {
    max-height: 0;
    padding: 0 16px;
    opacity: 0;
}

.section-score {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-block;
    min-width: 70px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.section-header i {
    margin-right: 10px;
    font-size: 18px;
    color: #fff;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.section-header > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.section-title {
    display: flex;
}

.section-title i {
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.section-title .title-text {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.section-hint {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
    font-style: italic;
}

.score-label i {
    margin-right: 8px;
    color: var(--primary);
    width: 18px;
    text-align: center;
}

.section-score:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

.section-body {
    padding: 16px;
    color: #333;
}

.feedback-section {
    margin-top: 10px;
    border-radius: 8px;
    padding: 10px;
    background: #fbfbff;
    border: 1px solid rgba(42,75,124,0.04);
}

.feedback-section h3 {
    color: var(--primary);
    /* margin-bottom: 8px; */
    text-transform: capitalize;
    font-size: 16px;
}

.feedback-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.feedback-header i {
    font-size: 18px;
    color: var(--primary);
}

.feedback-strength { border-left: 4px solid #2ecc71; }
.feedback-weakness { border-left: 4px solid #e74c3c; }
.feedback-suggestion { border-left: 4px solid #f1c40f; }

.list {
    display: grid;
    gap: 10px;
}

.item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(10,20,40,0.03);
    box-shadow: 0 2px 6px rgba(12,24,48,0.04);
}

.item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(42,75,124,0.06), rgba(42,75,124,0.03));
    color: var(--primary);
    flex-shrink: 0;
}

.item-content strong { color: var(--primary); }
.item-detail { margin-top:6px; color: #555; font-size: 13px; }

.list {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.item {
    background: var(--secondary);
    padding: 10px;
    border-radius: var(--radius);
    color: #333;
    text-align: justify;
}

.item strong {
    color: var(--primary);
}

.overview-enhanced {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    padding: 20px;
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.file-info {
    display: flex;
    flex-direction: column;
}

.overview-meta {
    display: flex;
    align-items: center;
    gap: 18px;
}

.file-name-block {
    display:flex;
    align-items:center;
    gap:10px;
    color: var(--muted);
}

.file-name-block i {
    color: #e74c3c;
    font-size: 20px;
}

.file-name-text { font-size: 14px; }

.overall-score-block {
    background: linear-gradient(90deg, rgba(42,75,124,0.12), rgba(73,107,184,0.12));
    padding: 8px 12px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 84px;
}

.overall-score-label { font-size: 11px; color: var(--muted); }
.overall-score-value { font-weight: 800; color: var(--primary); font-size: 16px; }

.overview-cards { display: grid; gap:12px; grid-template-columns: 1fr 1fr; margin-top: 12px; }

.overview-card { background:#fff; border-radius:8px; padding:12px; border:1px solid rgba(10,20,40,0.03); box-shadow: 0 1px 6px rgba(10,20,40,0.03); }
.overview-card-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; color:var(--primary); font-weight:500; }
.overview-card-header i { font-size:16px; }
.overview-card-body { color:#444; font-size:14px; }

@media (max-width:800px) {
    .overview-cards { grid-template-columns: 1fr; }
    .component-scores { max-width:100%; }
}

.file-name {
    font-weight: 500;
    color: var(--muted);
    font-size: 16px;
}

.file-score {
    color: #333;
    margin-top: 4px;
}

.overview-content h3,
.overview-content h4 {
    color: var(--primary);
    margin-bottom: 5px;
    margin-top: 10px;
}

.divider {
    border: none;
    height: 1px;
    background: #dfe3f1;
    margin: 12px 0;
}

.cta-section {
    text-align: center;
    margin: 25px auto;
    padding: 15px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.4s ease;
}

.cta-section p {
    margin-bottom: 10px;
    color: var(--muted);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.score-wrapper {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.overview-scores {
    display: flex;
    align-items: center;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}


.score-circle {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, #e0e3f5 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    box-shadow: 0 0 0 rgba(42, 75, 124, 0.3);
    transition: all 0.4s ease;
    animation: pulseGlow 2.5s infinite ease-in-out;
    flex-shrink: 0;
}

.score-circle::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 50%;
    z-index: 1;
}

.score-circle-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.score-label-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#scoreValue {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.component-scores {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
    max-width: 600px;
    width: 100%;
}

.score-item {
    display: grid;
    grid-template-columns: 200px 1fr 60px;
    align-items: center;
    gap: 12px;
}

.score-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-align: left;
}

.score-bar {
    height: 8px;
    background: #e4e7f7;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2A4B7C, #496BB8);
    border-radius: 4px;
    width: 0;
    transition: width 1.2s ease;
    box-shadow: 0 0 6px rgba(42, 75, 124, 0.3);
}

.score-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

.score-value::after {
    content: "/100";
    font-weight: 500;
    color: var(--muted);
    margin-left: 2px;
}

#retryBtn {
    margin-bottom: 5px;
    margin-right: 5px;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 rgba(42, 75, 124, 0.3);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 25px rgba(42, 75, 124, 0.4);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 0 0 rgba(42, 75, 124, 0.3);
        transform: scale(1);
    }
}

.progress-container {
    width: 80%;
    height: 12px;
    background: #e4e7f7;
    border-radius: 6px;
    margin: 20px auto 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 6px;
    transition: width 1.2s ease;
    box-shadow: 0 0 8px rgba(42, 75, 124, 0.4);
}

.progress-text {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px;
}

.cv-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--secondary);
    padding: 18px 10px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(42, 75, 124, 0.15);
}

/* tiêu đề chính */
.cv-header h1 {
    font-size: 2.1rem;
    font-weight: 800;
    background: linear-gradient(90deg, #2A4B7C, #496BB8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

/* mô tả phụ */
.cv-header p {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
}


@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .cv-header {
        position: static !important;
        top: auto !important;
        box-shadow: none !important;
        background: none !important;
        border: none !important;
        margin-bottom: 10px !important;
    }

    .cv-header h1,
    .cv-header p {
        text-align: center !important;
        /* giữ gradient text khi export PDF */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
    }

    #upload-page,
    #loading-page,
    #retryBtn,
    #cta-section {
        display: none !important;
    }

    .card,
    .result-section {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }

    footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        background: #2A4B7C;
        color: white;
        padding: 10px 0;
    }
}

/* ============================================= */
/* [BEGIN] Upload Section + CTA Enhancements  */
/* ============================================= */

/* Tiêu đề và mô tả trong khối Upload */
.upload-box h2 {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.upload-box p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 18px;
    text-align: center;
}

/* Label chọn file (đã cải tiến) */
.file-label {
    display: inline-block;
    background: linear-gradient(90deg, #2A4B7C, #496BB8);
    color: white;
    padding: 12px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: all .25s ease;
    margin-top: 5px;
    box-shadow: 0 3px 10px rgba(42, 75, 124, 0.2);
}

.file-label:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(42, 75, 124, 0.3);
}

/* Nút chính: CTA “Tải Lên & Phân Tích Ngay” */
.btn-upload {
    background: linear-gradient(90deg, #2A4B7C, #496BB8);
    color: #fff;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all .25s ease;
    box-shadow: 0 4px 15px rgba(42, 75, 124, 0.25);
}

.btn-upload:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(42, 75, 124, 0.35);
}

/* Dòng note nhỏ dưới nút */
.note-text {
    color: #67728a;
    font-size: 0.88rem;
    margin-top: 15px;
    text-align: center;
}

/* Hiệu ứng nhấn (pulse animation nhẹ) */
@keyframes pulseButton {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(42, 75, 124, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(42, 75, 124, 0.4); }
}

/* ============================================= */
/* [BEGIN] Upload Section + CTA Enhancements  */
/* ============================================= */
