/* styles.css */

/* 리셋 및 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #667eea;
    /* Brighter, more lively background gradient from moahub-landing */
    --bg-gradient: linear-gradient(135deg, #fff0f5 0%, #e0c3fc 50%, #8ec5fc 100%);
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    --card-hover-shadow: 0 15px 35px rgba(255, 107, 157, 0.2);
    --text-main: #333;
    --text-sub: #555;
    --radius-lg: 30px;
    --radius-md: 20px;
    --radius-sm: 15px;
    --font-heading: 'Jua', sans-serif;
    --font-body: 'Noto Sans KR', -apple-system, sans-serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Cute Background Patterns - Brighter */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(#ff9a9e 2px, transparent 2px),
        radial-gradient(#a18cd1 2px, transparent 2px),
        radial-gradient(white 2px, transparent 2px);
    background-size: 50px 50px, 40px 40px, 30px 30px;
    background-position: 0 0, 25px 25px, 10px 10px;
    opacity: 0.2;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

/* 히어로 섹션 */
.hero-section {
    padding: 60px 20px 60px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    padding: 60px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--text-main);
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-sub);
    margin-bottom: 20px;
    font-weight: 500;
}

.hero-description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 32px;
    max-width: 600px;
    line-height: 1.8;
}

/* 히어로 버튼 */
.hero-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* 버튼 사이 광고 */
.adfit-between-buttons {
    margin: 2px 0;
}

.cta-button {
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: white;
    font-size: 1.4rem;
    padding: 20px 40px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 20px rgba(255, 154, 158, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 154, 158, 0.6);
}

.cta-button.secondary {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 10px 20px rgba(161, 140, 209, 0.4);
}

.cta-button.secondary:hover {
    box-shadow: 0 15px 30px rgba(161, 140, 209, 0.6);
}

/* 로봇 이모지 */
.robot-emoji {
    font-size: 100px;
    animation: bounce 2s infinite ease-in-out;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.1));
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Hero Home Button - 박스 위에 배치 */
.home-btn-hero {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    margin-bottom: 16px;
    align-self: flex-start;
}

.home-btn-hero:hover {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }

    .hero-section {
        padding: 40px 16px 30px;
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        position: relative;
    }

    .hero-content {
        padding: 20px 20px;
        gap: 10px;
        position: relative;
    }

    /* 홈 버튼 - 박스 위에 배치 (모바일) */
    .home-btn-hero {
        font-size: 0.85rem;
        padding: 8px 14px;
        margin-bottom: 12px;
    }

    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 6px;
        /* Reduced */
        line-height: 1.2;
        margin-top: 5px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 6px;
        /* Reduced */
    }

    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 12px;
        /* Reduced */
        line-height: 1.4;
        word-break: keep-all;
    }

    .robot-emoji {
        font-size: 40px;
        margin-bottom: 4px;
        /* Reduced */
    }

    .hero-buttons {
        gap: 2px;
        /* Reduced for ad placement */
    }

    .cta-button {
        font-size: 1rem;
        padding: 12px 20px;
        width: 100%;
        margin-bottom: 0;
    }
}

/* 소개 섹션 */
.intro-section {
    padding: 20px 20px;
    /* Further reduced from 30px */
    background: transparent;
    position: relative;
    z-index: 10;
    margin-top: -10px;
    /* Pull it up slightly closer to hero */
}

/* Fix for sticky focus state */
.option-button:focus {
    outline: none;
    /* Remove default browser outline */
    /* Ensure it doesn't look 'selected' unless it has the class */
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 400;
    text-align: center;
    color: var(--text-main);
    margin-bottom: 48px;
}

.intro-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.intro-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 32px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid white;
    backdrop-filter: blur(5px);
}

.intro-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-hover-shadow);
    background: white;
}

.intro-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.intro-card:hover .intro-icon {
    transform: scale(1.2) rotate(10deg);
}

.intro-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 12px;
}

.intro-card p {
    color: var(--text-sub);
    line-height: 1.6;
}

/* 레벨 테스트 섹션 */
.level-test-section {
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.test-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    border: 3px solid white;
    position: relative;
    overflow: hidden;
}

.progress-container {
    margin-bottom: 40px;
}

.progress-text {
    text-align: right;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 16px;
    background: #eee;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9a9e 0%, #fecfef 100%);
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.3) 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    animation: moveStripe 1s linear infinite;
}

@keyframes moveStripe {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 0;
    }
}

.question-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 40px;
    line-height: 1.4;
    text-align: center;
    word-break: keep-all;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-button {
    background: white;
    border: 2px solid #eee;
    padding: 24px 30px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
    font-weight: 500;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.option-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: white;
    /* Ensure it stays white */
    border-color: #e2e8f0;
    /* Maintain original border or slight darken but not selection color */
}

.option-button.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(255, 107, 157, 0.3);
}

/* 결과 섹션 */
.result-section {
    padding: 40px 20px;
    min-height: 100vh;
}

.result-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    text-align: center;
    border: 3px solid white;
}

.result-header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 3px dashed #ffd1d1;
}

.result-emoji {
    font-size: 100px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.result-level {
    font-family: var(--font-heading);
    font-size: 3rem;
    background: linear-gradient(135deg, #ff6b9d 0%, #ffc3a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.result-summary {
    font-size: 1.3rem;
    color: var(--text-sub);
    font-weight: 500;
}

.result-block {
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    border: 2px solid #f0f0f0;
}

.result-block h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 16px;
    border-bottom: 2px solid #fecfef;
    padding-bottom: 8px;
    display: inline-block;
}

.result-block p,
.result-block li {
    font-size: 1.05rem;
    color: #555;
    line-height: 1.7;
}

.result-block ul {
    list-style: none;
}

.result-block li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.result-block li::before {
    content: '✨';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9em;
}

.result-buttons {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr 1fr;
    margin-top: 40px;
}

@media (max-width: 600px) {
    .result-buttons {
        grid-template-columns: 1fr;
    }
}

.btn-primary,
.btn-secondary {
    padding: 18px 30px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 8px 15px rgba(255, 107, 157, 0.3);
}

.btn-primary:hover {
    background: #ff5290;
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(255, 107, 157, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-sub);
    border: 2px solid #eee;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #ddd;
    transform: translateY(-3px);
}

/* 공유 버튼 */
.share-button-container {
    margin-top: 20px;
}

.share-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.share-btn:hover {
    background: #5a6fd6;
    transform: translateY(-2px);
}

/* 홈 버튼 */
.home-button-container {
    position: absolute;
    top: 20px;
    left: 20px;
}

.home-btn {
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.home-btn:hover {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 퀴즈 섹션 */
.quiz-section {
    padding: 40px 20px;
    min-height: 100vh;
}

.quiz-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    max-width: 800px;
    margin: 0 auto;
    border: 3px solid white;
    position: relative;
}

.quiz-option {
    background: white;
    border: 2px solid #eee;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quiz-option:hover {
    border-color: var(--secondary-color);
    background: #f0f4ff;
}

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

.quiz-option.correct {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.quiz-option.wrong {
    background: #f56565;
    color: white;
    border-color: #f56565;
}

.quiz-hint-container {
    text-align: center;
    margin-top: 30px;
}

.quiz-hint-btn {
    background: #edf2f7;
    color: #4a5568;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quiz-hint-btn:hover {
    background: #e2e8f0;
}

/* 정답/오답 표시 */
.quiz-answer-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

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

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

.quiz-answer-label {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.quiz-explanation {
    color: #4a5568;
    line-height: 1.6;
}

/* Result specific overrides for quiz */
.quiz-result-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.quiz-result-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    text-align: center;
    border: 3px solid white;
    position: relative;
    overflow: hidden;
}

.quiz-result-emoji {
    font-size: 100px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.quiz-result-level {
    font-family: var(--font-heading);
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.quiz-result-summary {
    font-size: 1.3rem;
    color: var(--text-sub);
    font-weight: 500;
}

.quiz-score-box {
    background: #f0f4ff;
    padding: 24px;
    border-radius: var(--radius-md);
    margin: 30px auto;
    display: inline-block;
    border: 2px solid #e0e7ff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.quiz-score {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--secondary-color);
    line-height: 1;
}

.score-total {
    font-size: 1.5rem;
    color: #a0aec0;
    font-weight: 600;
}

.quiz-result-description {
    margin-bottom: 40px;
    font-size: 1.1rem;
    color: #4a5568;
    line-height: 1.6;
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid #eee;
}

/* 공유 버튼 컨테이너 단순화 */
.share-button-container-simple {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

.btn-share {
    background: #667eea;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-share:hover {
    background: #5a6fd6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.quiz-review-list-inline {
    margin-top: 40px;
    text-align: left;
    border-top: 2px dashed #e2e8f0;
    padding-top: 30px;
}

.quiz-review-item {
    background: white;
    border: 2px solid #eee;
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.quiz-review-question {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.quiz-review-answer {
    color: var(--primary-color);
    font-weight: 600;
}


.score-total {
    font-size: 1.5rem;
    color: #a0aec0;
}

/* 푸터 */
.footer {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 30px 20px;
    text-align: center;
    margin-top: 60px;
    border-top: 2px solid rgba(255, 255, 255, 0.8);
}

.footer-links {
    margin-bottom: 16px;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-separator {
    margin: 0 8px;
    color: #ccc;
}

.footer p {
    color: #666;
    font-size: 0.9rem;
    margin: 4px 0;
}

@media (max-width: 600px) {
    .footer {
        padding: 24px 16px;
        margin-top: 40px;
    }

    .footer-links {
        font-size: 0.85rem;
    }

    .footer p {
        font-size: 0.85rem;
    }
}

/* ========================================
   캡처 전용 영역 스타일 (공유하기용)
   ======================================== */
.capture-area {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 400px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #a18cd1 100%);
    border-radius: 24px;
    z-index: -1;
    visibility: hidden;
    overflow: visible;
}

.capture-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
}

.capture-logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.capture-emoji {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.capture-level {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    background: linear-gradient(135deg, #ff6b9d 0%, #ffc3a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.3rem;
}

.capture-summary {
    font-size: 1rem;
    color: var(--text-sub);
    margin-bottom: 1rem;
}

.capture-score-box {
    background: #f0f4ff;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: inline-block;
    border: 2px solid #e0e7ff;
}

.capture-score {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.capture-score-total {
    font-size: 1.2rem;
    color: #a0aec0;
}

.capture-section {
    background: #f8f4ff;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.6rem;
    text-align: left;
}

.capture-section-title {
    color: #764ba2;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.capture-section-content {
    color: #333;
    font-size: 0.8rem;
    line-height: 1.5;
}

.capture-promo {
    background: linear-gradient(135deg, #ff6b9d 0%, #a18cd1 100%);
    padding: 1rem;
    border-radius: 16px;
    margin-top: 1rem;
    text-align: center;
}

.capture-promo p {
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.capture-promo .capture-url {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 0.3rem;
}