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

:root {
    --primary-color: #1f3b57;
    --primary-dark: #15273c;
    --primary-light: #4a637a;
    --secondary-color: #6d7585;
    --secondary-dark: #555d6b;
    --accent-color: #b38a58;
    --accent-rgb: 179, 138, 88;
    --success-color: #2f7a67;
    --background: #f5f6f8;
    --card-bg: #ffffff;
    --text-primary: #1f3b57;
    --text-secondary: #6f7a8a;
    --border-color: #dfe3ea;
    --primary-rgb: 31, 59, 87;
    --shadow: 0 4px 8px rgba(21, 31, 46, 0.08);
    --shadow-lg: 0 18px 30px rgba(21, 31, 46, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #e2e6ed 0%, #f7f4ef 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Override body padding for welcome-page */
.welcome-page {
    padding: 0 !important;
    display: block;
    justify-content: normal;
    align-items: normal;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    display: flex;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 42px 44px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.5s ease-in;
    max-width: 800px;
    width: 100%;
}

/* Glassmorphism effect for cards in welcome-page */
.welcome-page .welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-page .card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(203, 213, 225, 0.5);
    box-shadow: 0 8px 32px rgba(6, 182, 212, 0.2);
    position: relative;
    z-index: 2;
    margin: 0 auto;
    width: 100%;
}

/* Results page - wider card */
.results-page .card {
    max-width: 1200px;
}

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

.header {
    text-align: center;
    margin-bottom: 36px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 16px;
}

.top3-codes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px 0;
}

.code-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--type-primary, var(--primary-color)) 0%, var(--type-secondary, var(--primary-light)) 100%);
    color: white;
    font-size: 28px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    animation: subtlePulse 3.5s ease-in-out infinite;
}

.code-badge.highlighted {
    z-index: 10;
    animation: growShrinkCycle 3.5s ease-in-out forwards;
}

.code-badge:hover:not(.highlighted) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
}

.code-badge.highlighted:hover {
    animation-play-state: paused;
}

.code-badge::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 200%;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.code-badge:hover::before {
    opacity: 1;
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    }
}

@keyframes growShrinkCycle {
    0% {
        transform: scale(1);
        background: linear-gradient(135deg, var(--type-primary, var(--primary-color)) 0%, var(--type-secondary, var(--primary-light)) 100%);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.25);
        background: linear-gradient(135deg, var(--type-secondary, var(--primary-light)) 0%, var(--type-primary, var(--primary-color)) 100%);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 0 20px var(--type-light, rgba(var(--primary-rgb), 0.35));
    }
    100% {
        transform: scale(1);
        background: linear-gradient(135deg, var(--type-primary, var(--primary-color)) 0%, var(--type-secondary, var(--primary-light)) 100%);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}

@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Form Styles */
.form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

.form-row > .form-group {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 0;
    line-height: 1.4;
    min-height: 20px;
    display: flex;
    align-items: center;
    padding-bottom: 2px;
}

.required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group input,
.form-group select {
    padding: 13px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
    width: 100%;
    line-height: 1.5;
    min-height: 48px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-group select {
    cursor: pointer;
    padding-right: 40px;
    background: var(--card-bg);
    color: var(--text-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-group select option {
    color: var(--text-primary);
}


.education-other-input {
    display: none;
    margin-top: 10px;
    animation: slideDown 0.3s ease;
}

.education-other-input.show {
    display: block;
}

/* Education Fields Groups */
.education-fields {
    display: none;
    animation: slideDown 0.3s ease;
    margin-top: 4px;
    border-top: 1px solid var(--border-color);
}

.education-fields .form-group {
    margin-bottom: 0;
}

.education-fields[style*="display: block"] {
    display: block !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    padding: 15px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 50px;
    margin-top: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-pdf {
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

.btn-pdf:hover {
    background: linear-gradient(135deg, #C62828 0%, #B71C1C 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.4);
}

.btn-pdf:active {
    transform: translateY(0);
}

.btn-pdf i {
    font-size: 18px;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Questions */
.questions-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.question-card {
    display: none;
    animation: slideIn 0.3s ease;
}

.question-card.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.rating-scale {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rating-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
    user-select: none;
    -webkit-user-select: none;
}

.rating-option:hover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.05);
}

.rating-option:has(input[type="radio"]:checked),
.rating-option.selected {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.12);
}

.rating-option input[type="radio"] {
    margin-right: 16px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.rating-emoji {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
}

.rating-text {
    flex: 1;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 4px;
}

.results-page .form-actions {
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Print-only header and footer - hidden on screen */
.pdf-header-pro,
.pdf-footer-pro {
    display: none;
}

/* Results */
.results-container {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 40px;
    margin-bottom: 32px;
    align-items: center;
}

@media (max-width: 992px) {
    .results-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.chart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Header section on the right */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
}

.header-right h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.header-right .subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
}

.top3-codes-vertical {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.codes-hint {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
}

.code-badge-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--type-primary) 0%, var(--type-secondary) 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    flex: 1;
}

.code-badge-vertical:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.code-badge-vertical .rank-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.code-badge-vertical .code-letter {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 6px;
}

.code-badge-vertical .code-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.95;
}

.code-badge-vertical .code-score {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.9;
}

/* Top 3 Code Badge - Horizontal Layout */
.top3-code-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, var(--type-primary) 0%, var(--type-secondary) 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    flex: 1;
}

.top3-code-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.top3-code-badge .rank-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.top3-code-badge .code-letter {
    font-size: 28px;
    font-weight: 900;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    flex-shrink: 0;
}

.top3-code-badge .code-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top3-code-badge .code-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    opacity: 0.95;
}

.top3-code-badge .code-score {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.85;
}

/* Glow Ring Effect */
.code-badge-vertical::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 14px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.7) 0%, 
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.code-badge-vertical.highlighted::before {
    opacity: 1;
    animation: glowRing 2s ease-in-out infinite;
}

@keyframes glowRing {
    0%, 100% { 
        opacity: 0.6;
        transform: scale(1);
        filter: blur(1px);
    }
    50% { 
        opacity: 1;
        transform: scale(1.02);
        filter: blur(3px);
    }
}

.code-badge-vertical.highlighted {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.5),
                    0 0 15px rgba(255, 255, 255, 0.4);
        transform: scale(1.03);
    }
}

.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--background);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    position: relative;
}

.chart-tooltip {
    position: absolute;
    top: 50%;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    transform: translate(-50%, -50%);
}

.tooltip-content {
    background: var(--card-bg);
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    min-width: 200px;
    max-width: 250px;
    text-align: center;
}

.tooltip-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 6px 0;
    text-transform: uppercase;
}

.tooltip-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-style: italic;
    margin: -2px 0 6px 0;
}

.tooltip-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0 0 8px 0;
}

.tooltip-score {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.tooltip-score strong {
    color: var(--primary-color);
    font-size: 14px;
}

.score-card {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.score-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.score-card.top3 {
    border: 1.5px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.03) 100%);
    position: relative;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.12);
    animation: elegantGlow 4s ease-in-out infinite;
}

.score-card.top3::before {
    content: '';
    position: absolute;
    inset: -1.5px;
    border-radius: 10px;
    padding: 1.5px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light), rgba(var(--primary-rgb), 0.2), var(--primary-color));
    background-size: 400% 400%;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: elegantBorderFlow 4s ease-in-out infinite;
    border-radius: 10px;
    z-index: -1;
    opacity: 0.6;
}

.score-card.top3:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.2);
}

@keyframes elegantBorderFlow {
    0% {
        background-position: 0% 50%;
        opacity: 0.5;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.8;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0.5;
    }
}

@keyframes elegantGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.12);
    }
    50% {
        box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.2);
    }
}

.score-card h3 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.score-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Hide analysis section (Top 3 cards not needed anymore) */
.analysis-section {
    display: none;
}

.top-type-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.top-type-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.top-type-card p {
    opacity: 0.9;
    line-height: 1.6;
}

.recommendations {
    background: var(--background);
    padding: 24px;
    border-radius: 12px;
}

.recommendations h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.recommendations ul {
    list-style: none;
    padding: 0;
}

.recommendations li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.recommendations li:last-child {
    border-bottom: none;
}

.recommendations li::before {
    content: "✓ ";
    color: var(--success-color);
    font-weight: bold;
    margin-right: 8px;
}

/* Top 3 Cards */
.top3-accordion,
.top3-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.top3-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.top3-card.ai-enhanced {
    border-color: rgba(102, 126, 234, 0.3);
    background: linear-gradient(to right, rgba(102, 126, 234, 0.02), rgba(118, 75, 162, 0.02));
}

.top3-card.expanded {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.top3-card-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: background 0.3s ease;
}

.top3-card-header:hover {
    background: rgba(var(--primary-rgb), 0.03);
}

.top3-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.ai-badge-small {
    padding: 4px 10px;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: white;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.top3-card-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.top3-card-toggle i {
    transition: transform 0.3s ease;
    color: var(--primary-color);
    font-size: 14px;
}

.top3-card-toggle i.rotated {
    transform: rotate(180deg);
}

.top3-card:hover .top3-card-toggle {
    background: rgba(var(--primary-rgb), 0.2);
}

.top3-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    padding: 0 20px;
}

.top3-card-info {
    flex: 1;
}

.top3-card-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.top3-card-score {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.top3-card-score strong {
    color: var(--primary-color);
    font-size: 16px;
}

.top3-card-arrow {
    font-size: 20px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.top3-card:hover .top3-card-arrow {
    transform: translateX(4px);
    color: var(--primary-color);
}

/* AI Insight Section inside Top 3 Cards */
.ai-insight-section {
    padding-bottom: 20px;
}

.ai-insight-text {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-left: 4px solid #667eea;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

.ai-insight-text i {
    color: #667eea;
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.ai-insight-text p {
    margin: 0;
    line-height: 1.7;
    color: var(--text-primary);
}

.ai-careers-section {
    margin-top: 20px;
}

.ai-careers-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-career-cards {
    display: grid;
    gap: 12px;
}

.ai-career-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    transition: all 0.3s ease;
}

.ai-career-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
    transform: translateY(-2px);
}

.ai-career-card.user_preference {
    border-left: 4px solid var(--primary-color);
    background: rgba(var(--primary-rgb), 0.02);
}

.ai-career-card.riasec_analysis {
    border-left: 4px solid #764ba2;
    background: rgba(118, 75, 162, 0.02);
}

.ai-career-card .career-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ai-career-card .career-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ai-career-card .match-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.ai-career-card .match-badge.cao {
    background: rgba(47, 122, 103, 0.15);
    color: var(--success-color);
}

.ai-career-card .match-badge.trung-bình {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.ai-career-card .source-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.ai-career-card .source-badge.preferred {
    background: rgba(31, 59, 87, 0.1);
    color: var(--primary-color);
}

.ai-career-card .source-badge.ai {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-career-card .career-reason {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.basic-info {
    padding-bottom: 20px;
}

.basic-info p {
    margin-bottom: 16px;
    line-height: 1.7;
    color: var(--text-primary);
}

.careers-section {
    margin-top: 16px;
}

.careers-section h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.careers-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.accordion-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.15);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.02) 0%, rgba(var(--primary-rgb), 0.01) 100%);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.accordion-header:hover {
    background: var(--background);
}

.accordion-item.active .accordion-header {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.03) 0%, rgba(var(--primary-rgb), 0.01) 100%);
}

.accordion-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.rank-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.accordion-title h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.accordion-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.accordion-subtitle strong {
    color: var(--primary-color);
    font-size: 16px;
}

.accordion-arrow {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.accordion-item.active .accordion-arrow {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.accordion-item.active .accordion-content {
    max-height: 2000px;
}

.accordion-details {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-section {
    padding: 18px;
    background: rgba(var(--primary-rgb), 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 0;
}

.detail-section:first-child {
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.04) 0%, 
        rgba(var(--primary-rgb), 0.02) 100%);
}

.detail-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section p {
    color: var(--text-primary);
    line-height: 1.7;
    margin: 0;
    font-size: 15px;
}

.detail-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-section ul li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-primary);
    line-height: 1.6;
}

.detail-section ul li::before {
    content: "•";
    position: absolute;
    left: 6px;
    top: 6px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
    line-height: 1.6;
}

.career-highlight {
    border: 2px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 14px;
    padding: 24px;
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.06) 0%, 
        rgba(var(--accent-rgb), 0.08) 100%);
    box-shadow: 0 8px 24px rgba(20, 30, 47, 0.08);
    margin-top: 4px;
}

.career-highlight-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.career-highlight-header h4 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.career-highlight-header p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.career-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.25);
}

.careers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.career-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 999px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.12);
}

.career-tag:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    color: white;
    border-color: transparent;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.25);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.modal-content {
    overflow-y: auto;
    max-height: 90vh;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 28px 20px;
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.04) 0%, 
        rgba(var(--primary-rgb), 0.01) 100%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px);
}

.modal-rank-icon {
    font-size: 44px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.modal-title {
    flex: 1;
}

.modal-title h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    line-height: 1.2;
}

.modal-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-subtitle strong {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 700;
}

.modal-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 28px 24px;
    }
    
    .welcome-container {
        padding: 20px 16px;
    }
    
    .form {
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header {
        margin-bottom: 28px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .form-group {
        gap: 8px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .chart-wrapper {
        gap: 20px;
    }
    
    .chart-container {
        padding: 15px;
    }
    
    .tooltip-content {
        padding: 14px 16px;
    }
    
    .tooltip-content h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .tooltip-text {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .tooltip-score {
        font-size: 13px;
    }
    
    .tooltip-score strong {
        font-size: 15px;
    }
    
    .top3-codes {
        gap: 8px;
    }
    
    .code-badge {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .modal-container {
        max-width: 95%;
        margin: 20px;
    }
    
    .modal-content {
        padding: 24px;
    }
    
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .multi-select-dropdown {
        max-height: 250px;
    }
}

/* Multi-Select Dropdown Styles */
.multi-select-wrapper {
    position: relative;
    width: 100%;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    font-size: 15px;
    color: var(--text-primary);
}

.multi-select-trigger:hover {
    border-color: var(--primary-color);
}

.multi-select-trigger.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.multi-select-placeholder {
    color: var(--text-secondary);
}

.multi-select-trigger.has-selection .multi-select-placeholder {
    display: none;
}

.multi-select-arrow {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.multi-select-trigger.active .multi-select-arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.multi-select-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

.multi-select-options {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.multi-select-option:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.multi-select-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.multi-select-option span {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
}

.multi-select-option:has(input[type="checkbox"]:checked) {
    background: rgba(var(--primary-rgb), 0.1);
}

.multi-select-option:has(input[type="checkbox"]:checked) span {
    color: var(--primary-color);
    font-weight: 600;
}

.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    min-height: 24px;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(var(--primary-rgb), 0.1);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 16px;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
}

.multi-select-tag-remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--primary-color);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.multi-select-tag-remove:hover {
    opacity: 1;
}

/* Checkbox Group Styles (kept for backward compatibility) */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    margin-top: 0;
    min-height: 48px;
    align-content: start;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 32px;
}

.checkbox-label:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-label span {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    background: rgba(var(--primary-rgb), 0.1);
    font-weight: 600;
}

.checkbox-label:has(input[type="checkbox"]:checked) span {
    color: var(--primary-color);
}

/* Textarea Styles */
.form-group textarea {
    padding: 13px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
    width: 100%;
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.form-hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.4;
}

@media (max-width: 992px) {
    .checkbox-group {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 10px;
    }
    
    .welcome-container {
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .checkbox-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 10px;
    }
    
    .checkbox-label {
        padding: 5px 6px;
        min-height: 30px;
    }
    
    .checkbox-label span {
        font-size: 12px;
    }
    
    .checkbox-label input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
    
    .welcome-container {
        padding: 20px 16px;
    }
    
    .analysis-section h2 {
        font-size: 20px;
    }
    
    .section-subtitle {
        font-size: 14px;
    }
    
    .top3-card-content {
        padding: 14px 16px;
    }
    
    .top3-card-info h3 {
        font-size: 18px;
    }
    
    .top3-card-score {
        font-size: 13px;
    }
    
    .accordion-header {
        padding: 14px 16px;
    }
    
    .accordion-title h3 {
        font-size: 18px;
    }
    
    .accordion-subtitle {
        font-size: 13px;
    }
    
    .accordion-details {
        padding: 0 16px 16px 16px;
    }
    
    .career-highlight {
        padding: 20px;
    }
    
    .career-highlight-header h4 {
        font-size: 16px;
    }
    
    .career-tag {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .multi-select-tags {
        gap: 4px;
    }
    
    .multi-select-tag {
        font-size: 12px;
        padding: 5px 8px;
    }
}

@media (max-width: 480px) {
    .welcome-container {
        padding: 16px 12px;
    }
    
    .card {
        padding: 20px 16px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 12px 14px;
    }
    
    .btn {
        font-size: 14px;
        padding: 12px 24px;
        min-height: 44px;
    }
    
    .question-title {
        font-size: 18px;
    }
    
    .rating-text {
        font-size: 14px;
    }
    
    .modal-container {
        max-width: 100%;
        margin: 10px;
        border-radius: 12px;
    }
    
    .modal-content {
        padding: 20px;
    }
    
    .modal-title h2 {
        font-size: 20px;
    }
    
    .modal-subtitle {
        font-size: 14px;
    }
}

/* Open-ended Question Styles */
.open-ended-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.open-ended-input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-primary);
    width: 100%;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.open-ended-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.char-counter {
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 4px;
}

/* AI Analysis Section */
.ai-analysis-section {
    margin-top: 48px;
    position: relative;
}

/* Sparkles removed */

.ai-header {
    margin-bottom: 28px;
    text-align: center;
    position: relative;
}

/* Decorative lines beside badge - only show on larger screens */
.ai-header::before,
.ai-header::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(21, 101, 192, 0.5), transparent);
    pointer-events: none;
    display: none; /* Hidden by default */
}

@media (min-width: 768px) {
    .ai-header::before,
    .ai-header::after {
        display: block;
    }
    
    .ai-header::before {
        right: calc(50% + 180px);
    }

    .ai-header::after {
        left: calc(50% + 180px);
    }
}

@media (min-width: 1200px) {
    .ai-header::before {
        right: calc(50% + 200px);
        width: 100px;
    }

    .ai-header::after {
        left: calc(50% + 200px);
        width: 100px;
    }
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 50%, #1565C0 100%);
    background-size: 200% 200%;
    color: white;
    padding: 14px 32px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 17px;
    box-shadow: 0 8px 25px rgba(21, 101, 192, 0.4), 
                0 0 40px rgba(21, 101, 192, 0.2);
    animation: aiGradientShift 4s ease-in-out infinite, aiPulse 3s ease-in-out infinite;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    margin: 24px 0;
    z-index: 1;
}

/* Enhanced pulsing glow effect using box-shadows */

/* Sparkles removed per user request */

/* Ring pulse removed - using box-shadow animation instead */

/* Sparkle animations removed */

.ai-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 70%);
    animation: aiShimmer 3s linear infinite;
}

.ai-badge i {
    font-size: 20px;
    animation: robotSpin 4s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

@keyframes aiGradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes aiPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(21, 101, 192, 0.4), 
                    0 0 40px rgba(21, 101, 192, 0.2),
                    0 0 0 0 rgba(21, 101, 192, 0.4);
    }
    50% {
        box-shadow: 0 12px 35px rgba(21, 101, 192, 0.6), 
                    0 0 60px rgba(21, 101, 192, 0.4),
                    0 0 0 20px rgba(21, 101, 192, 0);
    }
}

@keyframes aiShimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes robotSpin {
    0%, 90%, 100% { 
        transform: rotate(0deg);
        opacity: 1;
    }
    5% {
        transform: rotate(-15deg);
    }
    10% {
        transform: rotate(15deg);
    }
    15% {
        transform: rotate(0deg);
    }
}

/* AI Tabs */
.ai-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    padding: 6px;
    background: rgba(var(--primary-rgb), 0.04);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ai-tab {
    flex: 1;
    min-width: 130px;
    padding: 14px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.ai-tab:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.08);
}

.ai-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.ai-tab i {
    font-size: 16px;
}

/* AI Tab Content */
.ai-tab-content {
    position: relative;
    min-height: 200px;
}

.ai-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.ai-tab-panel.active {
    display: block;
}

/* Insights Card */
.insights-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.insights-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.insights-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    margin: 0;
}

/* Insights Enhanced (Option 1 - Icon Highlights) */
.insights-enhanced {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insight-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.insight-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.insight-item.personality {
    border-color: #4A90E2;
}

.insight-item.strength {
    border-color: #26A69A;
}

.insight-item.career {
    border-color: #1565C0;
}

.insight-item.other {
    border-color: #667eea;
}

.insight-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 12px;
}

.insight-content {
    flex: 1;
}

.insight-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.insight-item.personality .insight-content h4 {
    color: #4A90E2;
}

.insight-item.strength .insight-content h4 {
    color: #26A69A;
}

.insight-item.career .insight-content h4 {
    color: #1565C0;
}

.insight-item.other .insight-content h4 {
    color: #667eea;
}

.insight-content p {
    margin: 0;
    line-height: 1.7;
    font-size: 15px;
    color: var(--text-primary);
    text-align: justify;
}

/* Strengths & Weaknesses */
.sw-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.strengths-card,
.weaknesses-card {
    padding: 24px;
    border-radius: 14px;
    border: 1px solid;
    background: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.strengths-card {
    border-color: rgba(47, 122, 103, 0.2);
}

.strengths-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--success-color);
}

.weaknesses-card {
    border-color: rgba(255, 152, 0, 0.2);
}

.weaknesses-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #ff9800;
}

.strengths-card h3,
.weaknesses-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 18px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strengths-card h3 {
    color: var(--success-color);
}

.strengths-card h3 i {
    font-size: 20px;
}

.weaknesses-card h3 {
    color: #ff9800;
}

.weaknesses-card h3 i {
    font-size: 20px;
}

.strengths-card ul,
.weaknesses-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.strengths-card li,
.weaknesses-card li {
    padding: 10px 0;
    font-size: 15px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.strengths-card li i {
    color: var(--success-color);
    margin-top: 4px;
    flex-shrink: 0;
}

.weaknesses-card li i {
    color: #ff9800;
    margin-top: 4px;
    flex-shrink: 0;
}

.strengths-card li.empty,
.weaknesses-card li.empty {
    color: var(--text-secondary);
    font-style: italic;
}

/* Recommendations */
.recommendations-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.recommendations-preferred,
.recommendations-additional {
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.preferred-badge {
    background: rgba(31, 59, 87, 0.1);
    color: var(--primary-color);
}

.ai-badge.badge {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 50%, #1565C0 100%);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.4),
                0 0 20px rgba(21, 101, 192, 0.2);
    animation: aiBadgeGlow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    font-weight: 700;
}

.ai-badge.badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 40%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 60%);
    animation: badgeShimmer 2.5s linear infinite;
}

@keyframes aiBadgeGlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 2px 8px rgba(21, 101, 192, 0.4),
                    0 0 20px rgba(21, 101, 192, 0.2);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 4px 12px rgba(21, 101, 192, 0.6),
                    0 0 30px rgba(21, 101, 192, 0.4);
    }
}

@keyframes badgeShimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.career-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.career-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.career-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.career-card.preferred {
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb), 0.02);
}

.career-card.preferred:hover {
    border-color: var(--primary-dark);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.15);
}

.career-card.additional {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.02);
}

.career-card.additional:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.career-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.career-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.match-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.match-badge.cao {
    background: rgba(47, 122, 103, 0.15);
    color: var(--success-color);
}

.match-badge.trung-bình {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
}

.match-badge.thấp {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.career-reason {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px 20px;
}

/* Roadmap */
.roadmap-container {
    margin-bottom: 0;
}

.roadmap-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.roadmap-step {
    display: flex;
    gap: 18px;
    padding: 24px;
    background: white;
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    transition: all 0.3s ease;
}

.roadmap-step:hover {
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.1);
    transform: translateX(4px);
}

.step-number {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

.step-content {
    flex: 1;
}

.step-content .step-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-content .step-title::before {
    content: '📍';
    font-size: 14px;
}

.step-content p {
    margin: 0;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 15px;
    text-align: justify;
}

.roadmap-paragraph {
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.roadmap-paragraph p {
    margin: 0;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 15px;
}

/* ============================================
   RESPONSIVE DESIGN - COMPREHENSIVE
   ============================================ */

/* ===== LARGE DESKTOP (1400px+) ===== */
@media (min-width: 1400px) {
    .card {
        max-width: 1400px;
        padding: 56px 64px;
    }
    
    .results-container {
        grid-template-columns: 520px 1fr;
        gap: 56px;
    }
    
    .chart-container canvas {
        max-width: 480px;
        max-height: 480px;
    }
}

/* ===== DESKTOP (1200px - 1399px) ===== */
@media (min-width: 1200px) and (max-width: 1399px) {
    .results-container {
        grid-template-columns: 500px 1fr;
        gap: 48px;
    }
}

/* ===== TABLET LANDSCAPE & SMALL DESKTOP (992px - 1199px) ===== */
@media (min-width: 992px) and (max-width: 1199px) {
    .card {
        padding: 38px 40px;
    }
    
    .results-container {
        grid-template-columns: 420px 1fr;
        gap: 32px;
    }
    
    .chart-container canvas {
        max-width: 380px;
        max-height: 380px;
    }
    
    .header-right h1 {
        font-size: 26px;
    }
    
    .top3-codes-vertical {
        gap: 10px;
    }
    
    .top3-code-badge {
        padding: 16px 14px;
        min-width: 120px;
    }
}

/* ===== TABLET PORTRAIT (768px - 991px) ===== */
@media (min-width: 768px) and (max-width: 991px) {
    .card {
        padding: 32px 36px;
    }
    
    .results-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .chart-container canvas {
        max-width: 400px;
        max-height: 400px;
    }
    
    .header-right h1 {
        font-size: 26px;
    }
    
    .header-right .subtitle {
        font-size: 15px;
    }
    
    .top3-codes-vertical {
        flex-direction: row;
        gap: 12px;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .top3-code-badge {
        flex: 1;
        min-width: 160px;
    }
    
    .ai-badge {
        font-size: 16px;
        padding: 12px 28px;
    }
    
    .ai-tabs {
        gap: 6px;
    }
    
    .ai-tab {
        min-width: 110px;
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .career-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .sw-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Modal - Tablet */
    .modal-header {
        padding: 24px 24px 18px 24px;
        gap: 16px;
    }
    
    .modal-body {
        padding: 20px 24px 24px;
        gap: 18px;
    }
    
    .detail-section {
        padding: 16px;
        margin-bottom: 14px;
    }
    
    .detail-section:last-child {
        margin-bottom: 0;
    }
}

/* ===== MOBILE LARGE (576px - 767px) ===== */
@media (min-width: 576px) and (max-width: 767px) {
    .card {
        padding: 28px 28px;
        border-radius: 14px;
    }
    
    .results-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .chart-container canvas {
        max-width: 350px;
        max-height: 350px;
    }
    
    .header-right h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .header-right .subtitle {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .top3-codes-vertical {
        flex-direction: column;
        gap: 12px;
        max-width: 100%;
    }
    
    .top3-code-badge {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 18px 20px;
    }
    
    .codes-hint {
        font-size: 13px;
        margin-top: 16px;
    }
    
    /* AI Section */
    .ai-analysis-section {
        margin-top: 36px;
    }
    
    .ai-badge {
        font-size: 15px;
        padding: 12px 24px;
        gap: 10px;
    }
    
    .ai-badge i {
        font-size: 18px;
    }
    
    .ai-tabs {
        gap: 4px;
        padding: 5px;
    }
    
    .ai-tab {
        min-width: 90px;
        padding: 11px 10px;
        font-size: 12px;
        gap: 6px;
    }
    
    .ai-tab i {
        font-size: 16px;
    }
    
    /* Show abbreviated text on smaller tablets */
    .ai-tab span {
        display: inline;
    }
    
    /* Content */
    .insights-card {
        padding: 22px;
    }
    
    .insights-text {
        font-size: 15px;
        line-height: 1.7;
    }
    
    /* Modal - Mobile Large */
    .modal-header {
        padding: 20px 20px 16px 20px;
        gap: 16px;
    }
    
    .modal-body {
        padding: 18px 20px 22px;
        gap: 16px;
    }
    
    .detail-section {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .detail-section:last-child {
        margin-bottom: 0;
    }
    
    .sw-container {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .career-cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .career-card {
        padding: 18px;
    }
    
    .section-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .section-header h3 {
        font-size: 17px;
    }
}

/* ===== MOBILE SMALL (< 576px) ===== */
@media (max-width: 575px) {
    body {
        padding: 10px;
    }
    
    .card {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    /* Results Header Section */
    .results-container {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .chart-wrapper {
        gap: 12px;
    }
    
    .chart-container {
        padding: 8px;
    }
    
    .chart-container canvas {
        max-width: 100%;
        max-height: 260px;
    }
    
    .header-right h1 {
        font-size: 20px;
        margin-bottom: 6px;
        line-height: 1.3;
    }
    
    .header-right .subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    /* Top 3 Codes - Compact on Mobile */
    .top3-codes-vertical {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .top3-code-badge {
        width: 100%;
        padding: 10px 12px;
        min-width: unset;
        gap: 10px;
    }
    
    .top3-code-badge .rank-icon {
        font-size: 16px;
    }
    
    .top3-code-badge .code-letter {
        font-size: 20px;
        width: 38px;
        height: 38px;
        border-radius: 8px;
    }
    
    .top3-code-badge .code-info {
        flex: 1;
        text-align: left;
    }
    
    .top3-code-badge .code-name {
        font-size: 13px;
        margin-bottom: 2px;
    }
    
    .top3-code-badge .code-score {
        font-size: 11px;
    }
    
    .codes-hint {
        font-size: 11px;
        margin-top: 10px;
    }
    
    /* AI Analysis Section */
    .ai-analysis-section {
        margin-top: 24px;
    }
    
    .ai-header {
        margin-bottom: 16px;
    }
    
    .ai-badge {
        font-size: 13px;
        padding: 9px 18px;
        gap: 6px;
        border-radius: 20px;
        letter-spacing: 0.3px;
    }
    
    .ai-badge i {
        font-size: 15px;
    }
    
    /* AI Tabs - Better Mobile Layout */
    .ai-tabs {
        gap: 4px;
        padding: 4px;
        border-radius: 10px;
        margin-bottom: 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .ai-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .ai-tab {
        min-width: 80px;
        flex: 0 0 auto;
        padding: 12px 8px;
        font-size: 11px;
        gap: 4px;
        flex-direction: column;
        border-radius: 10px;
    }
    
    .ai-tab span {
        display: block;
        font-size: 10px;
        line-height: 1.3;
        text-align: center;
        word-wrap: break-word;
        max-width: 100%;
    }
    
    .ai-tab i {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    /* Tab Content */
    .ai-tab-content {
        min-height: 120px;
    }
    
    .insights-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .insights-card h4 {
        font-size: 16px;
        margin-bottom: 14px;
    }
    
    .insights-text {
        font-size: 14px;
        line-height: 1.8;
        text-align: justify;
    }
    
    /* Insight Items */
    .insight-item {
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }
    
    .insight-icon {
        margin: 0 auto;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .insight-content h4 {
        font-size: 14px;
    }
    
    .insight-content p {
        font-size: 13px;
        line-height: 1.6;
    }
    
    /* Strengths/Weaknesses */
    .sw-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .strengths-card,
    .weaknesses-card {
        padding: 14px;
    }
    
    .strengths-card h3,
    .weaknesses-card h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .strengths-card ul,
    .weaknesses-card ul {
        gap: 8px;
    }
    
    .strengths-card li,
    .weaknesses-card li {
        font-size: 13px;
        padding-left: 22px;
    }
    
    /* Career Cards */
    .recommendations-preferred,
    .recommendations-additional {
        margin-bottom: 20px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 14px;
    }
    
    .section-header h3 {
        font-size: 15px;
    }
    
    .career-cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .career-card {
        padding: 14px;
    }
    
    .career-card h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .career-card p {
        font-size: 12.5px;
        line-height: 1.6;
        margin-bottom: 10px;
    }
    
    .career-details {
        gap: 6px;
    }
    
    .career-detail {
        font-size: 11px;
    }
    
    /* Roadmap */
    .roadmap-content {
        gap: 16px;
    }
    
    .roadmap-step {
        gap: 14px;
        padding: 20px 16px;
    }
    
    .step-number {
        min-width: 36px;    
        font-size: 15px;
        flex-shrink: 0;
    }
    
    .step-content .step-title {
        font-size: 15px;
        margin-bottom: 10px;
        line-height: 1.4;
    }
    
    .step-content p {
        font-size: 14px;
        line-height: 1.75;
        text-align: justify;
    }
    
    .roadmap-paragraph {
        padding: 16px;
    }
    
    .roadmap-paragraph p {
        font-size: 14px;
        line-height: 1.75;
    }
    
    /* Form Actions */
    .form-actions {
        margin-top: 24px;
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
    }
    
    .btn-pdf {
        order: -1;
    }
    
    /* Modal - Optimized for Mobile */
    .modal-overlay {
        padding: 12px;
    }
    
    .modal-container {
        margin: 0;
        max-width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
        top: 12px;
        right: 12px;
    }
    
    .modal-header {
        padding: 16px 16px 14px 16px;
        margin-bottom: 0;
        gap: 14px;
    }
    
    .modal-header .type-box {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .modal-header .rank-icon {
        font-size: 32px;
    }
    
    .modal-rank-icon {
        font-size: 32px;
    }
    
    .modal-title h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .modal-subtitle {
        font-size: 13px;
    }
    
    .modal-body {
        padding: 16px;
        gap: 12px;
    }
    
    .modal-content h3 {
        font-size: 15px;
        margin-top: 0;
        margin-bottom: 10px;
    }
    
    .modal-content h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .modal-content p {
        font-size: 13px;
        line-height: 1.7;
        margin-bottom: 0;
    }
    
    .modal-content ul {
        font-size: 13px;
        line-height: 1.7;
        margin: 0;
    }
    
    .modal-content ul li {
        margin-bottom: 6px;
        padding: 6px 0;
    }
    
    .modal-content ul li:last-child {
        margin-bottom: 0;
    }
    
    .detail-section {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .detail-section:last-child {
        margin-bottom: 0;
    }
    
    .detail-section h4 {
        margin-bottom: 10px;
        font-size: 14px;
    }
    
    .detail-section ul {
        gap: 4px;
    }
    
    .detail-section ul li {
        padding-left: 18px;
    }
    
    .detail-section ul li::before {
        left: 4px;
        top: 6px;
        font-size: 14px;
    }
}

/* ===== EXTRA SMALL MOBILE (< 375px) ===== */
@media (max-width: 374px) {
    body {
        padding: 8px;
    }
    
    .card {
        padding: 18px 14px;
    }
    
    .header-right h1 {
        font-size: 18px;
    }
    
    .chart-container {
        padding: 6px;
    }
    
    .chart-container canvas {
        max-height: 240px;
    }
    
    .top3-code-badge {
        padding: 9px 10px;
        gap: 8px;
    }
    
    .top3-code-badge .rank-icon {
        font-size: 14px;
    }
    
    .top3-code-badge .code-letter {
        font-size: 18px;
        width: 34px;
        height: 34px;
    }
    
    .top3-code-badge .code-name {
        font-size: 12px;
    }
    
    .top3-code-badge .code-score {
        font-size: 10px;
    }
    
    .ai-badge {
        font-size: 12px;
        padding: 8px 16px;
    }
    
    .ai-badge i {
        font-size: 14px;
    }
    
    .ai-tab {
        padding: 10px 6px;
        min-width: 75px;
    }
    
    .ai-tab span {
        font-size: 9px;
        line-height: 1.3;
    }
    
    .ai-tab i {
        font-size: 16px;
    }
    
    .insights-card,
    .career-card {
        padding: 16px;
    }
    
    .insights-card h4 {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .insights-text {
        font-size: 13px;
        line-height: 1.75;
    }
    
    .insight-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .insight-content h4 {
        font-size: 13px;
    }
    
    .insight-content p {
        font-size: 12px;
    }
    
    /* Modal - Extra Small */
    .modal-container {
        border-radius: 14px;
    }
    
    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }
    
    .modal-header {
        padding: 14px 14px 12px 14px;
        gap: 12px;
    }
    
    .modal-header .type-box {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }
    
    .modal-header .rank-icon {
        font-size: 28px;
    }
    
    .modal-rank-icon {
        font-size: 28px;
    }
    
    .modal-title h2 {
        font-size: 17px;
    }
    
    .modal-subtitle {
        font-size: 12px;
    }
    
    .modal-body {
        padding: 14px;
        gap: 10px;
    }
    
    .modal-content h3 {
        font-size: 14px;
        margin-top: 0;
    }
    
    .modal-content h4 {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .modal-content p {
        font-size: 12px;
        line-height: 1.7;
        margin-bottom: 0;
    }
    
    .modal-content ul {
        font-size: 12px;
        line-height: 1.7;
        margin: 0;
    }
    
    .modal-content ul li {
        margin-bottom: 5px;
        padding: 5px 0;
    }
    
    .modal-content ul li:last-child {
        margin-bottom: 0;
    }
    
    .detail-section {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .detail-section:last-child {
        margin-bottom: 0;
    }
    
    .detail-section h4 {
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .detail-section ul {
        gap: 2px;
    }
    
    .detail-section ul li {
        padding-left: 16px;
    }
    
    .detail-section ul li::before {
        left: 3px;
        top: 5px;
        font-size: 13px;
    }
    
    /* Roadmap Extra Small */
    .roadmap-step {
        padding: 16px 14px;
        gap: 12px;
    }
    
    .step-number {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .step-content .step-title {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .step-content p {
        font-size: 13px;
        line-height: 1.75;
    }
    
    .btn {
        padding: 11px 20px;
        font-size: 13px;
    }
}

/* ===== AI LOADING OVERLAY ===== */
.ai-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(30, 64, 175, 0.97) 0%, 
        rgba(37, 99, 235, 0.97) 50%,
        rgba(59, 130, 246, 0.97) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ai-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ai-loading-content {
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
    max-width: 500px;
    padding: 40px;
}

.ai-loading-icon {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.ai-loading-icon i {
    position: relative;
    font-size: 60px;
    color: white;
    z-index: 2;
    animation: robotBounceLoading 2s ease-in-out infinite;
    display: block;
    line-height: 120px;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.5));
}

@keyframes robotBounceLoading {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) scale(1.05) rotate(-5deg);
    }
    50% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) scale(1.05) rotate(5deg);
    }
}

.ai-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: aiPulseRing 2s ease-out infinite;
}

.ai-pulse-ring.delay-1 {
    animation-delay: 0.5s;
}

.ai-pulse-ring.delay-2 {
    animation-delay: 1s;
}

@keyframes aiPulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.ai-loading-title {
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.ai-loading-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-weight: 500;
}

.ai-loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.ai-loading-dots span {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

.ai-loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.ai-loading-tips {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.tip-text {
    color: white;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    font-weight: 500;
    animation: tipFadeIn 0.5s ease-out;
}

@keyframes tipFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive for loading overlay */
@media (max-width: 768px) {
    .ai-loading-content {
        padding: 30px 20px;
        max-width: 90%;
    }
    
    .ai-loading-icon {
        width: 100px;
        height: 100px;
    }
    
    .ai-loading-icon i {
        font-size: 50px;
        line-height: 100px;
    }
    
    .ai-loading-title {
        font-size: 26px;
    }
    
    .ai-loading-subtitle {
        font-size: 16px;
    }
    
    .tip-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ai-loading-icon {
        width: 80px;
        height: 80px;
    }
    
    .ai-loading-icon i {
        font-size: 40px;
        line-height: 80px;
    }
    
    .ai-loading-title {
        font-size: 22px;
    }
    
    .ai-loading-subtitle {
        font-size: 14px;
    }
    
    .ai-loading-dots span {
        width: 10px;
        height: 10px;
    }
}

/* ===== LANDSCAPE MODE OPTIMIZATION ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .card {
        padding: 24px;
    }
    
    .results-container {
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .chart-container canvas {
        max-height: 280px;
    }
    
    .ai-analysis-section {
        margin-top: 24px;
    }
    
    .modal-container {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    @page {
        size: A4;
        margin: 12mm 15mm 15mm 15mm;
    }
    
    /* Try to hide browser default header/footer */
    html {
        margin: 0;
    }
    
    body {
        background: white !important;
        padding: 0 !important;
    }
    
    .floating-elements,
    .hm-logo,
    .form-actions,
    .ai-tabs,
    .codes-hint,
    .modal-overlay {
        display: none !important;
    }
    
    .welcome-page {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        background: white !important;
        border: none !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    
    /* Use actual page header */
    /* Professional PDF Header */
    .pdf-header-pro {
        display: block !important;
        background: linear-gradient(135deg, #1f3b57 0%, #2a4d6e 100%);
        color: white;
        padding: 15px 20px;
        margin: -10px -10px 20px -10px;
        border-radius: 0;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .pdf-header-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
        gap: 20px;
    }
    
    .pdf-logo {
        text-align: left;
    }
    
    .logo-image {
        height: 50px;
        width: auto;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        filter: brightness(0) invert(1);
    }
    
    .pdf-meta {
        text-align: right;
    }
    
    .test-title {
        font-size: 14pt;
        font-weight: bold;
        color: white !important;
        margin-bottom: 4px;
        line-height: 1.3;
    }
    
    .test-type {
        font-size: 10pt;
        color: rgba(255, 255, 255, 0.85) !important;
        font-style: italic;
    }
    
    .pdf-header-bottom {
        display: flex;
        gap: 30px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        font-size: 9pt;
    }
    
    .user-info-line,
    .date-info-line {
        display: flex;
        gap: 8px;
    }
    
    .pdf-header-bottom .label {
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    .pdf-header-bottom .value {
        color: white !important;
        font-weight: 600;
    }
    
    /* Hide original screen header when printing */
    .header-right h1,
    .header-right .subtitle {
        display: none !important;
    }
    
    .header-right {
        margin-top: 0 !important;
    }
    
    .results-container {
        page-break-inside: avoid;
        margin-bottom: 10px !important;
        gap: 10px !important;
        grid-template-columns: 1fr !important;
    }
    
    .chart-wrapper {
        order: -1;
        margin-bottom: 5px !important;
    }
    
    .header-right {
        text-align: center;
        margin-bottom: 0 !important;
    }
    
    .chart-container {
        page-break-inside: avoid;
        max-width: 450px !important;
        margin: 0 auto 8px auto !important;
        padding: 8px !important;
    }
    
    .chart-container canvas {
        max-height: 410px !important;
    }
    
    .top3-codes-vertical {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
        margin: 10px 0 8px 0 !important;
    }
    
    .top3-code-badge {
        flex: 1 !important;
        max-width: 170px !important;
        min-width: 140px !important;
        padding: 10px 8px !important;
        page-break-inside: avoid;
    }
    
    .top3-code-badge .code-letter {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
    
    /* Force Top 3 badges to have solid backgrounds */
    .code-badge-vertical,
    .top3-code-badge {
        background: linear-gradient(135deg, var(--type-primary) 0%, var(--type-secondary) 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        opacity: 1 !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
    }
    
    .top3-code-badge .rank-icon,
    .top3-code-badge .code-letter,
    .top3-code-badge .code-name,
    .top3-code-badge .code-score,
    .code-badge-vertical .rank-icon,
    .code-badge-vertical .code-letter,
    .code-badge-vertical .code-name,
    .code-badge-vertical .code-score {
        color: white !important;
    }
    
    .top3-code-badge .code-name {
        font-size: 11pt !important;
        margin-bottom: 2px !important;
    }
    
    .top3-code-badge .code-score {
        font-size: 9pt !important;
    }
    
    .rank-icon {
        font-size: 18px !important;
        margin-bottom: 3px !important;
    }
    
    /* Remove ::before glow effect on print */
    .code-badge-vertical::before,
    .top3-code-badge::before {
        display: none !important;
    }
    
    /* Show all AI tabs content for printing */
    .ai-tab-panel {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 25px;
    }
    
    /* Add section titles before each tab content */
    .ai-tab-panel#tab-insights::before {
        content: "📊 INSIGHTS - PHÂN TÍCH";
        display: block;
        font-size: 14pt;
        font-weight: bold;
        color: #1f3b57;
        margin-bottom: 12px;
        margin-top: 20px;
        border-bottom: 2px solid #b38a58;
        padding-bottom: 6px;
    }
    
    .ai-tab-panel#tab-strengths::before {
        content: "💪 ĐIỂM MẠNH & CẦN CẢI THIỆN";
        display: block;
        font-size: 14pt;
        font-weight: bold;
        color: #1f3b57;
        margin-bottom: 12px;
        margin-top: 20px;
        border-bottom: 2px solid #b38a58;
        padding-bottom: 6px;
    }
    
    .ai-tab-panel#tab-careers::before {
        content: "💼 GỢI Ý NGHỀ NGHIỆP";
        display: block;
        font-size: 14pt;
        font-weight: bold;
        color: #1f3b57;
        margin-bottom: 12px;
        margin-top: 20px;
        border-bottom: 2px solid #b38a58;
        padding-bottom: 6px;
    }
    
    .ai-tab-panel#tab-roadmap::before {
        content: "🗺️ LỘ TRÌNH PHÁT TRIỂN";
        display: block;
        font-size: 14pt;
        font-weight: bold;
        color: #1f3b57;
        margin-bottom: 12px;
        margin-top: 20px;
        border-bottom: 2px solid #b38a58;
        padding-bottom: 6px;
    }
    
    .ai-badge {
        animation: none !important;
        box-shadow: none !important;
        background: #1565C0 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    .ai-analysis-section {
        page-break-inside: avoid;
        margin-top: 30px;
    }
    
    /* Ensure colors print */
    .top3-code-badge,
    .type-box,
    .career-card,
    .insight-item {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
    
    
    /* Compact all sections for print */
    .ai-analysis-section {
        margin-top: 10px !important;
    }
    
    .ai-header {
        margin-bottom: 8px !important;
    }
    
    .ai-badge {
        margin: 6px 0 !important;
        padding: 5px 14px !important;
        font-size: 10pt !important;
        background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%) !important;
    }
    
    .ai-tab-panel {
        margin-bottom: 12px !important;
    }
    
    .ai-tab-panel::before {
        margin-top: 8px !important;
        margin-bottom: 8px !important;
        padding-bottom: 4px !important;
        font-size: 12pt !important;
    }
    
    .insights-card {
        padding: 10px !important;
        page-break-inside: avoid;
        margin-bottom: 0 !important;
    }
    
    .insights-enhanced {
        gap: 8px !important;
    }
    
    .sw-container {
        gap: 12px !important;
        page-break-inside: avoid;
    }
    
    .strengths-card h3,
    .weaknesses-card h3 {
        color: #1f3b57 !important;
        font-size: 12pt !important;
    }
    
    .strengths-card li,
    .weaknesses-card li {
        color: #333 !important;
        font-size: 9.5pt !important;
        line-height: 1.4 !important;
    }
    
    .recommendations-container,
    .roadmap-container {
        page-break-inside: avoid;
    }
    
    .insight-item {
        margin: 6px 0 !important;
        padding: 8px !important;
        page-break-inside: avoid;
    }
    
    .insight-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
    
    .insight-content h4 {
        font-size: 11pt !important;
        margin-bottom: 4px !important;
        color: #1f3b57 !important;
    }
    
    .insight-content p {
        font-size: 9.5pt !important;
        line-height: 1.4 !important;
        color: #333 !important;
    }
    
    .career-card {
        margin: 6px 0 !important;
        padding: 8px !important;
        page-break-inside: avoid;
    }
    
    .career-card h4 {
        color: #1f3b57 !important;
        font-size: 11pt !important;
    }
    
    .career-card p {
        color: #333 !important;
        font-size: 9pt !important;
        line-height: 1.4 !important;
    }
    
    .roadmap-step {
        margin: 8px 0 !important;
        padding: 10px !important;
        page-break-inside: avoid;
        background: white !important;
    }
    
    .step-number {
        background: #1f3b57 !important;
        color: white !important;
    }
    
    .roadmap-step h4,
    .step-title {
        color: #1f3b57 !important;
        font-size: 11pt !important;
    }
    
    .roadmap-step p,
    .step-content p,
    .step-content {
        color: #333 !important;
        font-size: 9.5pt !important;
        line-height: 1.4 !important;
    }
    
    .roadmap-paragraph {
        background: white !important;
    }
    
    .roadmap-paragraph p {
        color: #333 !important;
        font-size: 9.5pt !important;
    }
    
    .section-header {
        margin-bottom: 10px !important;
    }
    
    .section-header h3 {
        font-size: 12pt !important;
        color: #1f3b57 !important;
    }
    
    /* Force darker text colors for better print readability */
    body {
        color: #333 !important;
    }
    
    p,
    li {
        color: #333 !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #1f3b57 !important;
    }
    
    /* Specific text areas */
    .insight-content p,
    .career-card p,
    .roadmap-step p,
    .step-content,
    .step-content p,
    .roadmap-paragraph p,
    .strengths-card li,
    .weaknesses-card li {
        color: #333 !important;
    }
    
    /* AI Badges keep white text and solid background */
    .ai-badge,
    .ai-badge span,
    .ai-badge i {
        color: white !important;
        background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%) !important;
    }
    
    .badge.ai-badge,
    .badge.ai-badge span {
        color: white !important;
        background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%) !important;
    }
    
    /* Preferred badge - solid color for print */
    .preferred-badge {
        background: #1f3b57 !important;
        color: white !important;
    }
    
    /* Match badges - solid colors for print */
    .match-badge.cao {
        background: #2f7a67 !important;
        color: white !important;
    }
    
    .match-badge.trung-bình,
    .match-badge.trung-binh {
        background: #ff9800 !important;
        color: white !important;
    }
    
    .match-badge.thấp,
    .match-badge.thap {
        background: #f44336 !important;
        color: white !important;
    }
    
    /* Ensure all colored elements print correctly */
    .top3-code-badge,
    .ai-badge,
    .badge,
    .preferred-badge,
    .match-badge,
    .career-card,
    .insight-item,
    .roadmap-step,
    .strengths-card,
    .weaknesses-card {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Professional PDF Footer */
    .pdf-footer-pro {
        display: block !important;
        background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
        padding: 12px 20px;
        margin: 25px -10px -10px -10px;
        border-top: 2px solid #b38a58;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .pdf-footer-pro .footer-left {
        float: left;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .footer-logo-img {
        height: 40px;
        width: auto;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .footer-info {
        border-left: 2px solid #b38a58;
        padding-left: 12px;
    }
    
    .footer-brand {
        font-size: 10pt;
        font-weight: bold;
        color: #1f3b57 !important;
        margin-bottom: 2px;
    }
    
    .footer-tagline {
        font-size: 8pt;
        color: #666 !important;
        font-style: italic;
    }
    
    .pdf-footer-pro .footer-right {
        float: right;
        text-align: right;
    }
    
    .footer-contact {
        font-size: 8.5pt;
        color: #555 !important;
        line-height: 1.5;
    }
    
    .footer-contact i {
        color: #b38a58 !important;
        width: 12px;
        text-align: center;
        margin-right: 6px;
        font-size: 8pt;
        display: inline-block;
    }
    
    .footer-contact div {
        margin-bottom: 2px;
        color: #555 !important;
        display: flex;
        align-items: center;
    }
    
    /* Clear floats */
    .pdf-footer-pro::after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* Remove animations */
    * {
        animation: none !important;
        transition: none !important;
    }
}

