/* Global Styles */
:root {
    --bg-color: #0f0f13;
    --text-color: #ffffff;
    --primary-color: #724cfe;
    --secondary-color: #24242e;
    --accent-color: #00e5ff;
    --gradient-1: linear-gradient(135deg, #724cfe 0%, #00e5ff 100%);
    --gradient-text: linear-gradient(45deg, #ffffff 30%, #724cfe 100%);
    --font-main: 'Pretendard', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden; /* Prevent scrolling for SPA feel */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 480px; /* Mobile first constrained width */
    height: 100%;
    position: relative;
    background: radial-gradient(circle at top right, rgba(114, 76, 254, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(0, 229, 255, 0.1), transparent 40%);
    overflow-y: auto; /* Scroll inside container if needed */
    scrollbar-width: none;
}

.app-container::-webkit-scrollbar {
    display: none;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center vertically by default */
    align-items: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    z-index: 10;
}

.hidden {
    display: none;
}

/* Landing Section */
#landing .content-wrapper {
    text-align: center;
    z-index: 2;
}

.logo-area {
    margin-bottom: 4rem;
    position: relative;
}

#landing h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #999);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.highlight {
    color: var(--primary-color);
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: #aaa;
    margin-top: 1rem;
}

/* Floating Shapes Animation */
.floating-shapes {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    animation: float 6s infinite ease-in-out;
}

.shape-1 {
    width: 150px;
    height: 150px;
    background: var(--primary-color);
    top: -50px;
    left: -20px;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    background: var(--accent-color);
    bottom: -30px;
    right: -20px;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -20px); }
}

/* Buttons */
.btn-primary {
    background: var(--gradient-1);
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(114, 76, 254, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(114, 76, 254, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Quiz Section */
#quiz {
    justify-content: flex-start;
    padding-top: 4rem;
}

.progress-container {
    width: 100%;
    margin-bottom: 3rem;
    text-align: center;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-1);
    border-radius: 10px;
    transition: width 0.4s ease;
}

#progress-text {
    font-size: 0.9rem;
    color: #888;
    font-weight: 500;
}

.question-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-card h2 {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    line-height: 1.4;
    text-align: center;
    word-break: keep-all; /* Korean word break */
}

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

.btn-option {
    background: rgba(36, 36, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 16px;
    color: #ddd;
    font-size: 1.05rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-option:hover {
    background: rgba(114, 76, 254, 0.15);
    border-color: var(--primary-color);
    color: #fff;
    transform: scale(1.01);
}

.option-label {
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.btn-option:hover .option-label {
    background: var(--primary-color);
    color: #fff;
}

/* Loading */
.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

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

/* Result Section */
#result {
    text-align: center;
    overflow-y: auto;
}

.result-subtitle {
    color: #aaa;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.highlight-text {
    font-size: 3.5rem;
    font-family: var(--font-heading);
    color: var(--primary-color);
    text-shadow: 0 0 20px rgba(114, 76, 254, 0.5);
    margin-bottom: 0px;
}

#mbti-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.type-icon {
    font-size: 5rem;
    margin-bottom: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mbti-desc-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    line-height: 1.6;
    color: #ccc;
    text-align: left;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 480px) {
    .app-container {
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
}
