/* ==========================================
   공부 MBTI 테스트 페이지 스타일
   ========================================== */

/* 색상 테마 - index.html과 동일한 보라색 테마 적용 */
:root {
    --primary: #6B5EFF;
    --primary-dark: #5648CC;
    --primary-light: #8B7EFF;
    --primary-lighter: #A99EFF;
    --primary-pale: #E5E0FF;
}

/* 히어로 섹션 */
.mbti-hero {
    background: linear-gradient(135deg, #F8F9FA 0%, #E5E0FF 100%);
    padding: 140px 0 60px;
    text-align: center;
}

.mbti-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.mbti-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF85D4 0%, #FFA94D 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.mbti-hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, #6B5EFF 0%, #FF85D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mbti-hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.mbti-preview {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mbti-type-badge {
    background: white;
    border: 2px solid var(--primary-light);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
}

.mbti-type-badge:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    background: var(--primary);
    color: white;
}

/* 시작 화면 */
.mbti-start {
    padding: 60px 0;
    background: var(--bg-light);
}

.start-card {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.start-icon {
    margin-bottom: 32px;
}

.start-card h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.start-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.start-features {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 0 auto 40px;
    padding: 0;
}

.start-features li {
    font-size: 16px;
    color: var(--text-primary);
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}

.start-features li:last-child {
    border-bottom: none;
}

.btn-start {
    background: linear-gradient(135deg, #6B5EFF 0%, #8B7EFF 100%);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(107, 94, 255, 0.3);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(107, 94, 255, 0.4);
}

.start-note {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-tertiary);
}

/* 테스트 진행 섹션 */
.mbti-test {
    padding: 60px 0 80px;
    background: var(--bg-light);
    min-height: 600px;
}

.test-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 진행률 */
.progress-wrapper {
    margin-bottom: 40px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #F3F4F6 0%, #E5E7EB 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    position: relative;
    height: 100%;
    background: linear-gradient(90deg, #6B5EFF 0%, #8B7EFF 50%, #FF85D4 100%);
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 2px 8px rgba(107, 94, 255, 0.3);
    overflow: hidden;
}

.progress-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 질문 카드 */
.question-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 40px 0;
    text-align: center;
    line-height: 1.4;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-btn {
    background: var(--bg-light);
    border: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 16px;
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.option-text {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
}

.option-btn:hover {
    border-color: var(--primary-light);
    background: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.option-btn.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #F8F9FA 0%, #E5E0FF 100%);
}

.option-btn.selected .option-letter {
    background: var(--primary);
    color: white;
}

/* 네비게이션 */
.test-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.btn-nav {
    flex: 1;
    padding: 16px 32px;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-nav:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-pale);
}

.btn-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-next {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.btn-next:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* 로딩 화면 */
.mbti-loading {
    padding: 100px 0;
    background: var(--bg-light);
    min-height: 500px;
}

.loading-card {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.loading-spinner {
    margin-bottom: 32px;
}

.loading-card h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 결과 섹션 */
.mbti-result {
    padding: 60px 0 80px;
    background: var(--bg-light);
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.result-card {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.6s ease;
}

.result-type {
    text-align: center;
    padding-bottom: 40px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 40px;
}

.result-badge {
    display: inline-block;
    font-size: 64px;
    font-weight: 900;
    background: linear-gradient(135deg, #6B5EFF 0%, #FF85D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: 4px;
}

.result-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.result-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
}

.result-stats {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--primary-pale);
    padding: 16px 32px;
    border-radius: var(--radius-lg);
}

.stat-icon {
    font-size: 24px;
}

.stat-label {
    font-size: 16px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.result-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title .emoji {
    font-size: 28px;
}

.result-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.result-list {
    list-style: none;
    padding: 0;
}

.result-list li {
    font-size: 16px;
    color: var(--text-primary);
    padding: 12px 0 12px 32px;
    position: relative;
    line-height: 1.6;
}

.result-list li::before {
    content: "•";
    position: absolute;
    left: 12px;
    color: var(--primary);
    font-size: 20px;
    font-weight: bold;
}

/* 결과 액션 버튼 */
.result-actions {
    max-width: 800px;
    margin: 40px auto 0;
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 더 알아보기 링크 */
.more-info-section {
    max-width: 800px;
    margin: 32px auto 0;
    text-align: center;
}

.more-info-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #F8F9FA 0%, #E5E0FF 100%);
    padding: 20px 40px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--primary-light);
    transition: all 0.3s;
}

.more-info-link:hover {
    background: linear-gradient(135deg, #E5E0FF 0%, #D0C8FF 100%);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.more-info-link .arrow-icon {
    font-size: 20px;
    transition: transform 0.3s;
}

.more-info-link:hover .arrow-icon {
    transform: translateX(4px);
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-800);
    color: white;
    padding: 16px 32px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, #6B5EFF 0%, #8B7EFF 100%);
}

.toast.error {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF5252 100%);
}

.toast-icon {
    font-size: 20px;
}

/* 공유 모달 */
#shareModal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#shareModal.modal-overlay.show {
    display: flex;
    opacity: 1;
}

#shareModal .modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#shareModal.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

#shareModal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--gray-100);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

#shareModal .modal-close:hover {
    background: var(--gray-200);
    color: var(--text-primary);
    transform: rotate(90deg);
}

#shareModal .modal-header {
    text-align: center;
    margin-bottom: 32px;
}

#shareModal .modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

#shareModal .modal-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

#shareModal .modal-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.share-option:hover {
    border-color: var(--primary);
    background: white;
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.share-option-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.share-option-text h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.share-option-text p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* 관련 테스트 */
.related-tests {
    padding: 80px 0;
    background: white;
}

.section-header {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 48px;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.test-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.test-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.test-icon {
    margin-bottom: 20px;
}

.test-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.test-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .mbti-hero-title {
        font-size: 36px;
    }

    .mbti-hero-description {
        font-size: 16px;
    }

    .start-card {
        padding: 40px 24px;
    }

    .start-card h2 {
        font-size: 24px;
    }

    .question-card {
        padding: 40px 24px;
    }

    .question-title {
        font-size: 22px;
    }

    .option-btn {
        padding: 20px 24px;
        gap: 16px;
    }

    .option-letter {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .option-text {
        font-size: 16px;
    }

    .result-card {
        padding: 40px 24px;
    }

    .result-badge {
        font-size: 48px;
    }

    .result-title {
        font-size: 28px;
    }

    .result-subtitle {
        font-size: 18px;
    }

    .section-title {
        font-size: 20px;
    }

    .test-navigation {
        flex-direction: column;
    }

    .btn-nav {
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .more-info-link {
        padding: 16px 24px;
        font-size: 14px;
    }

    .toast {
        bottom: 16px;
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(100px);
        max-width: calc(100% - 32px);
        padding: 14px 20px;
        font-size: 14px;
    }

    .toast.show {
        transform: translateX(0) translateY(0);
    }

    .modal-content {
        padding: 32px 24px;
        width: 95%;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-subtitle {
        font-size: 14px;
    }

    .share-option {
        padding: 16px;
        gap: 12px;
    }

    .share-option-icon {
        width: 48px;
        height: 48px;
    }

    .share-option-text h4 {
        font-size: 16px;
    }

    .share-option-text p {
        font-size: 13px;
    }

    .premium-cta-card {
        padding: 32px 24px;
    }

    .premium-title {
        font-size: 24px;
    }

    .premium-description {
        font-size: 16px;
    }

    .premium-features li {
        font-size: 14px;
    }

    .price-discount {
        font-size: 28px;
    }

    .btn-premium {
        width: 100%;
        justify-content: center;
        font-size: 16px;
        padding: 16px 32px;
    }
}

/* 프리미엄 CTA 섹션 */
.premium-cta-section {
    max-width: 800px;
    margin: 60px auto 0;
    padding: 0;
}

.premium-cta-card {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF4D6 100%);
    border: 3px solid #FFD700;
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 48px rgba(255, 215, 0, 0.5);
    }
}

.premium-cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(255, 165, 0, 0.4);
    position: relative;
    z-index: 1;
}

.premium-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.premium-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.premium-features {
    list-style: none;
    padding: 0;
    margin: 0 0 32px 0;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}

.premium-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}

.premium-features li svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.premium-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.price-original {
    font-size: 20px;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.price-discount {
    font-size: 36px;
    font-weight: 900;
    color: #FF6B00;
}

.price-badge {
    background: #FF6B00;
    color: white;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
}

.btn-premium {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 6px 24px rgba(255, 165, 0, 0.4);
    text-decoration: none;
    position: relative;
    z-index: 1;
    margin-bottom: 16px;
}

.btn-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(255, 165, 0, 0.6);
    background: linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);
}

.premium-note {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    position: relative;
    z-index: 1;
}

/* 추가 모바일 최적화 */
@media (max-width: 768px) {
    .option-btn {
        min-height: 56px;
        padding: 16px 20px;
        font-size: 15px;
    }

    #prevBtn,
    #nextBtn {
        min-height: 48px;
        padding: 14px 24px;
    }

    .question-card {
        padding: 24px 20px;
    }

    .result-card {
        padding: 24px 20px;
    }

    .share-buttons button {
        min-height: 48px;
        padding: 14px;
    }

    input, select, textarea {
        font-size: 16px !important;
    }

    .mbti-result-badge {
        font-size: 48px;
        padding: 24px;
    }

    .result-nickname {
        font-size: 24px;
    }
}

@media (max-width: 375px) {
    .option-btn {
        font-size: 14px;
        padding: 14px 16px;
    }

    .mbti-result-badge {
        font-size: 40px;
    }
}
