:root {
    --primary: #4a6fa5;
    --primary-light: #6d8ebc;
    --primary-dark: #3a5a8a;
    --secondary: #f0f4f8;
    --accent: #ff8c42;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --white: #ffffff;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --glass: rgba(255, 255, 255, 0.8);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section Management */
.view {
    display: none;
    min-height: 100vh;
    padding: 4rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.view.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
}

/* Landing Section */
#landing {
    text-align: center;
    position: relative;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(74, 111, 165, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.highlight {
    color: var(--accent);
    font-style: italic;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

/* Language Toggle */
/* Language Toggle */
.lang-toggle-container {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 100;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 0.4rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    transition: all 0.3s ease;
}

.lang-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 40px rgba(31, 38, 135, 0.2);
}

.lang-option {
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lang-option.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.lang-option:not(.active):hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

/* Language Visibility */
.ko .en {
    display: none !important;
}

.en .ko {
    display: none !important;
}

/* Specific badge style */
.badge {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
}

.test-preview-card {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    padding: 1rem 2rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
}

.preview-item .icon {
    font-size: 2rem;
}

.preview-item .text {
    text-align: left;
}

.preview-item strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-primary-lg {
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(74, 111, 165, 0.3);
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    z-index: 2000;
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.btn-primary-lg:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(74, 111, 165, 0.4);
}

.disclaimer {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Quiz Section */
.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#current-step {
    font-weight: 700;
    color: var(--primary);
    min-width: 60px;
}

.progress-track {
    flex-grow: 1;
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
}

.question-card {
    background: var(--white);
    padding: 4rem;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.question-text {
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
    line-height: 1.4;
    text-align: center;
    min-height: 80px;
    /* Fixed height to prevent layout shift */
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 0.9rem 1.5rem;
    background: var(--white);
    border: 2px solid #edf2f7;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.option:hover {
    background: #eef2f7;
    border-color: var(--primary-light);
}

.option input[type="radio"] {
    display: none;
}

.option.selected {
    background: var(--secondary);
    border-color: var(--primary);
}

.radio-label {
    font-size: 1.1rem;
    font-weight: 500;
}

.quiz-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.btn-secondary {
    padding: 1rem 2rem;
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary-small {
    padding: 1rem 3rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary-small:disabled,
.btn-secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Info Section (SEO) */
.info-section {
    margin-top: 4rem;
    text-align: left;
    padding-top: 4rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.info-section h3 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.info-section p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
}

.info-card h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Ad Containers */
.ad-container {
    margin: 2rem 0;
    min-height: 100px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-top {
    margin-top: 3rem;
}

/* Result Section */
section {
    padding: 60px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-title {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.result-badge {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 1rem 0;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.chart-area {
    background: var(--white);
    padding: 3rem 4rem;
    /* Increased padding */
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-matrix {
    width: 260px;
    /* Slightly smaller for 1080p fit */
    height: 260px;
    border-left: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    background-color: rgba(255, 255, 255, 0.5);
    /* Visual aid for grid */
}

.quadrant {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px dashed rgba(0, 0, 0, 0.05);
}

.quadrant span {
    background: var(--white);
    padding: 2px 5px;
}

.axis-y {
    position: absolute;
    top: 0;
    left: -50px;
    /* Position strictly outside to the left */
    height: 100%;
    width: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    text-align: center;
}

.axis-x {
    position: absolute;
    bottom: -40px;
    /* Position strictly outside */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.axis-label {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
}

.axis-y .axis-label {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 2px;
}

.axis-y .label-min,
.axis-y .label-max {
    transform: none;
    /* No rotation needed */
    font-size: 0.7rem;
    color: var(--text-muted);
}

.result-dot {
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--accent);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 140, 66, 0.5);
    z-index: 10;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.info-area {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.score-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.score-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

.score-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.score-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.description-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.description-box h3 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Loading Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--secondary);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }

    .test-preview-card {
        flex-direction: column;
        gap: 1rem;
    }

    .question-card {
        padding: 2rem;
    }

    .question-text {
        font-size: 1.4rem;
    }

    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }
}