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

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --menu-text-color: rgba(255, 255, 255, 0.7);
    --menu-text-hover: white;
    --menu-active-bg: rgba(255, 255, 255, 0.15);
    --menu-border-color: white;
}

/* 강아지 테마 (따뜻한 베이지/브라운 계열) */
body.dog-theme {
    --primary-color: #d97706;
    --primary-hover: #b45309;
    --secondary-color: #fbbf24;
    --success-color: #d97706;
    --bg-gradient-start: #fef9e7;
    --bg-gradient-end: #fef3c7;
    --menu-text-color: rgba(120, 53, 15, 0.8);
    --menu-text-hover: #78350f;
    --menu-active-bg: rgba(120, 53, 15, 0.1);
    --menu-border-color: #78350f;
}

/* 고양이 테마 (차분한 크림/베이지 계열) */
body.cat-theme {
    --primary-color: #c2782f;
    --primary-hover: #a56525;
    --secondary-color: #e8c9a8;
    --success-color: #d97706;
    --bg-gradient-start: #fef3e2;
    --bg-gradient-end: #f5e6d3;
    --menu-text-color: rgba(92, 64, 51, 0.8);
    --menu-text-hover: #5c4033;
    --menu-active-bg: rgba(92, 64, 51, 0.1);
    --menu-border-color: #5c4033;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* 메뉴바 */
.pet-menu {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; /* Firefox - 스크롤바 보이도록 */
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    position: relative;
}

/* 메뉴 컨테이너 래퍼 (그라데이션 효과용) */
.menu-wrapper {
    position: relative;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

.menu-wrapper::before,
.menu-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-gradient-start), transparent);
}

.menu-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-gradient-end), transparent);
}

/* 스크롤 가능 상태 표시 */
.menu-wrapper.scroll-start::after {
    opacity: 1;
}

.menu-wrapper.scroll-middle::before,
.menu-wrapper.scroll-middle::after {
    opacity: 1;
}

.menu-wrapper.scroll-end::before {
    opacity: 1;
}

/* 스크롤 힌트 애니메이션 */
@keyframes scrollHint {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.pet-menu.hint-animation {
    animation: scrollHint 2s ease-in-out 0.5s 1;
}

.pet-menu::-webkit-scrollbar {
    height: 4px;
}

.pet-menu::-webkit-scrollbar-track {
    background: transparent;
}

.pet-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.pet-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.menu-item {
    flex-shrink: 0;
    width: 114px;
    text-align: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--menu-text-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.menu-item:hover {
    color: var(--menu-text-hover);
    background: rgba(0, 0, 0, 0.05);
}

.menu-item.active {
    color: var(--menu-text-hover);
    background: var(--menu-active-bg);
    border-bottom-color: var(--menu-border-color);
}

.menu-icon {
    font-size: 1.4rem;
}

/* 헤더 */
header {
    position: relative;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 헤더 상단 영역 (제목 + 언어 선택기) */
header .header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* 언어 선택기 */
.language-selector {
    flex-shrink: 0;
}

.language-selector select {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.language-selector select:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.language-selector select option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 8px;
}

header h1 {
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
}

header p {
    font-size: 1.3rem;
    font-weight: 700;
    opacity: 0.95;
    margin: 0;
    text-align: center;
}

/* 헤더 광고 영역 */
.header-ad {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.header-ad iframe {
    width: 100%;
    max-width: 680px;
    height: 140px;
    border: none;
}

.header-ad p {
    font-size: 0.55rem;
    opacity: 0.7;
    margin: 5px 0 0 0;
    text-align: center;
}

/* 모바일 대응 */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 1.1rem;
        font-weight: 700;
    }

    .language-selector select {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .header-ad {
        margin-top: 10px;
    }

    .header-ad iframe {
        height: 100px;
    }
}

/* 메인 콘텐츠 */
main {
    padding: 40px 20px;
}

/* 업로드 영역 */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f0f3ff;
}

.upload-icon {
    width: 80px;
    height: 80px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.upload-btn:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-lg);
}

/* 미리보기 영역 */
.preview-section {
    text-align: center;
}

.preview-section img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 24px;
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-analyze,
.btn-reset,
.btn-retry {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

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

.btn-analyze:hover {
    background: #059669;
}

.btn-reset,
.btn-retry {
    background: var(--text-secondary);
    color: white;
}

.btn-reset:hover,
.btn-retry:hover {
    background: #475569;
}

/* 광고 영역 */
.ad-section {
    text-align: center;
}

.ad-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.ad-container h2 {
    color: var(--primary-color);
    margin-bottom: 24px;
    font-size: 1.2rem;
}

.ad-content {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px dashed var(--primary-color);
    margin-bottom: 24px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    border-radius: 12px;
}

.ad-content:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.ad-inner {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

.ad-text {
    position: absolute;
    bottom: 9px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    background: rgba(67, 67, 67, 0.6);
    margin: 0;
    padding: 3px 10px;
    text-align: center;
    line-height: 1.5;
    border-radius: 8px;
    backdrop-filter: blur(0px);
    z-index: 10;
    width: auto;
    max-width: 85%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ad-placeholder {
    text-align: center;
}

.ad-placeholder p {
    font-size: 1.2rem;
    margin: 8px 0;
}

.ad-placeholder p:first-child {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-start-analysis {
    padding: 16px 40px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: default;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    pointer-events: none;
}

.btn-start-analysis span:first-child {
    font-size: 1.3rem;
}

/* 로딩 영역 */
.loading-section {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 결과 영역 */
.result-section {
    animation: fadeIn 0.5s ease;
}

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

.result-section h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 32px;
    font-size: 2rem;
}

/* 결과 이미지 컨테이너 */
.result-image-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 24px;
}

/* 결과 브랜딩 헤더 (이미지 저장/공유용) */
.result-branding {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    padding: 10px 28px;
    text-align: center;
    border-radius: 16px 16px 0 0;
    margin-bottom: 20px;
}

.branding-title {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.branding-url {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0.95;
}

/* 인포그래픽 컨테이너 */
.result-content {
    display: grid;
    margin-bottom: 24px;
}

/* 인포그래픽 카드 */
.info-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.1);
    border: 2px solid #e8eaf6;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.info-card:hover {
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.card-content {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.05rem;
}

.card-content p {
    margin: 5px 0;
}

.card-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-content li {
    padding: 5px 0;
    padding-left: 32px;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

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

.card-content li::before {
    content: '🐾';
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* 성격 태그 */
.personality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.personality-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.personality-tag:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* 특징 아이템 */
.feature-item {
    display: flex;
    align-items: start;
    gap: 12px;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 12px;
    margin-bottom: 8px;
}

.feature-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feature-text {
    flex: 1;
}

/* 점수 그래프 */
.score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.score-item {
    background: #f8f9ff;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.score-item:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.score-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.score-emoji {
    font-size: 1.3rem;
}

.score-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-left: auto;
}

.score-bar-container {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.score-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    transition: width 1s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.score-comment {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 결과 액션 버튼 */
.result-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: -20px;
}

.btn-download,
.btn-share {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-download:hover {
    box-shadow: var(--shadow-lg);
}

.btn-share {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-share:hover {
    box-shadow: var(--shadow-lg);
}

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

/* 푸터 */
footer {
    text-align: center;
    padding: 5px 20px 20px 20px;
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    /* 메뉴바 모바일 */
    .pet-menu {
        scrollbar-width: none; /* Firefox */
    }

    .pet-menu::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .menu-item {
        font-size: 0.75rem;
        padding: 12px 8px;
        width: 75px;
        gap: 4px;
    }

    .menu-icon {
        font-size: 1.2rem;
    }

    /* 언어 선택기 모바일 */
    .language-selector {
        position: static;
    }

    .language-selector select {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 1rem;
        font-weight: 700;
    }

    main {
        padding: 24px 16px;
    }

    .upload-area {
        padding: 40px 16px;
    }

    .upload-icon {
        width: 60px;
        height: 60px;
    }

    .upload-area p {
        font-size: 0.85rem;
    }

    .preview-section img {
        max-height: 300px;
    }

    .result-section h2 {
        font-size: 1.3rem;
    }

    /* 인포그래픽 카드 모바일 */
    .info-card {
        padding: 20px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-content {
        font-size: 0.8rem;
    }

    .personality-tag {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .btn-analyze,
    .btn-reset,
    .btn-retry,
    .upload-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    /* 광고 영역 모바일 */
    .ad-container {
        max-width: 100%;
        padding: 20px 10px;
    }

    .ad-container h2 {
        font-size: 1rem;
        padding: 0 10px;
    }

    .ad-content {
        min-height: 150px;
    }

    .ad-image {
        max-height: 300px;
    }

    .ad-text {
        font-size: 0.7rem;
        padding: 3px 3px;
        bottom: 5px;
        max-width: 88%;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* 점수 그래프 모바일 */
    .score-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .score-item {
        padding: 10px;
    }

    .score-label {
        font-size: 0.85rem;
    }

    .score-value {
        font-size: 1.1rem;
    }

    .score-comment {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    /* 모바일에서 아이콘 위에 작은 텍스트 표시 */
    .pet-menu {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
    }

    .pet-menu::-webkit-scrollbar {
        display: none;
    }

    .menu-item {
        flex-direction: column;
        gap: 2px;
        padding: 8px 4px;
        text-align: center;
        flex-shrink: 0;
        min-width: 70px;
    }

    .menu-item span:not(.menu-icon) {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .menu-icon {
        font-size: 1.5rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    .container {
        border-radius: 16px;
    }

    .upload-area {
        padding: 30px 12px;
    }

    /* 인포그래픽 카드 작은 모바일 */
    .info-card {
        padding: 16px;
    }

    .card-header {
        gap: 8px;
    }

    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-content {
        font-size: 0.8rem;
    }

    /* 광고 영역 작은 모바일 */
    .ad-container h2 {
        font-size: 1rem;
    }

    .ad-content {
        min-height: 120px;
    }

    .ad-image {
        max-height: 250px;
    }

    .ad-text {
        font-size: 0.7rem;
        padding: 2px 8px;
        bottom: 3px;
        max-width: 90%;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* ========================================
   MBTI 테스트 스타일
   ======================================== */

/* MBTI 테마 */
body.mbti-theme {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary-color: #a78bfa;
    --success-color: #8b5cf6;
    --bg-gradient-start: #f5f3ff;
    --bg-gradient-end: #ede9fe;
    --menu-text-color: rgba(109, 40, 217, 0.8);
    --menu-text-hover: #6d28d9;
    --menu-active-bg: rgba(109, 40, 217, 0.1);
    --menu-border-color: #6d28d9;
}

/* MBTI 시작 화면 */
.mbti-start-section {
    text-align: center;
    padding: 20px 20px;
}

.mbti-intro h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.mbti-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.intro-note {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    color: #92400e;
    margin: 20px auto;
    max-width: 500px;
}

.mbti-start-button-container {
    margin-top: 20px;
    text-align: center;
}

.mbti-start-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 20px 60px;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.mbti-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.mbti-start-btn:active {
    transform: translateY(-1px);
}

.start-icon {
    font-size: 1.6rem;
}

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

/* MBTI 질문 섹션 */
.mbti-questions-section {
    padding: 30px 20px;
    max-width: 700px;
    margin: 0 auto;
}

.mbti-progress {
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.question-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.question-number {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.6;
    font-weight: 500;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-btn {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 25px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 15px;
}

.answer-btn:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.answer-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.answer-btn.selected .option-letter {
    background: white;
    color: var(--primary-color);
    font-weight: 700;
}

.answer-btn .option-letter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

/* MBTI 이전 버튼 */
.mbti-previous-btn {
    margin-top: 30px;
    padding: 12px 30px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mbti-previous-btn::before {
    content: '←';
    font-size: 1.2rem;
}

.mbti-previous-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateX(-3px);
}

.mbti-previous-btn:active {
    transform: translateX(-5px);
}

/* MBTI 다음 버튼 */
.mbti-next-btn {
    margin-top: 30px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mbti-next-btn::after {
    content: '→';
    font-size: 1.2rem;
}

.mbti-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

/* MBTI 결과 섹션 */
.mbti-result-section {
    padding: 15px 15px;
}

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

.result-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.pet-name-display {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.mbti-type-card {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border-radius: 100px;
    margin-bottom: 15px;
}

/* MBTI 16가지 유형별 색상 */
/* Analysts (분석가형) - 보라/남보라 계열 */
.mbti-type-card.INTJ {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.mbti-type-card.INTP {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

.mbti-type-card.ENTJ {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
}

.mbti-type-card.ENTP {
    background: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%);
}

/* Diplomats (외교관형) - 초록/청록 계열 */
.mbti-type-card.INFJ {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.mbti-type-card.INFP {
    background: linear-gradient(135deg, #14b8a6 0%, #2dd4bf 100%);
}

.mbti-type-card.ENFJ {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
}

.mbti-type-card.ENFP {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
}

/* Sentinels (관리자형) - 파란 계열 */
.mbti-type-card.ISTJ {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.mbti-type-card.ISFJ {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
}

.mbti-type-card.ESTJ {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
}

.mbti-type-card.ESFJ {
    background: linear-gradient(135deg, #0ea5e9 0%, #7dd3fc 100%);
}

/* Explorers (탐험가형) - 주황/노랑 계열 */
.mbti-type-card.ISTP {
    background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
}

.mbti-type-card.ISFP {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.mbti-type-card.ESTP {
    background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
}

.mbti-type-card.ESFP {
    background: linear-gradient(135deg, #ec4899 0%, #f9a8d4 100%);
}

.mbti-type-badge {
    display: inline-block;
    font-size: 3rem;
    font-weight: 800;
    color: white;
    letter-spacing: 8px;
}

.mbti-type-title {
    font-size: 1.5rem;
    color: white;
    font-weight: 600;
}

.mbti-details {
    display: flex;
    flex-direction: column;
}

.mbti-dimensions {
    background: white;
    border-radius: 12px;
    padding: 10px;
}

.dimension-item {
    margin-bottom: 20px;
}

.dimension-item:last-child {
    margin-bottom: 0;
}

.dimension-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.dimension-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.dimension-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.mbti-description,
.mbti-traits,
.mbti-tips {
    background: white;
    border-radius: 15px;
    padding: 10px;
}

.mbti-description h4,
.mbti-traits h4,
.mbti-tips h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mbti-description p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
}

.trait-list,
.tip-list {
    list-style: none;
}

.trait-list li,
.tip-list li {
    padding: 12px 0;
    color: var(--text-secondary);
    line-height: 1.6;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.trait-list li:last-child,
.tip-list li:last-child {
    border-bottom: none;
}

.trait-list li::before {
    content: "✨";
    flex-shrink: 0;
}

.tip-list li::before {
    content: "💡";
    flex-shrink: 0;
}

/* PC 화면 레이아웃 (태블릿 이상) */
@media (min-width: 769px) {
    .mbti-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        align-items: start;
    }

    .mbti-dimensions,
    .mbti-description {
        grid-column: 1 / -1;
    }

    .mbti-traits,
    .mbti-tips {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .trait-list,
    .tip-list {
        flex: 1;
    }
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .mbti-start-btn {
        padding: 10px 30px;
        font-size: 1.1rem;
    }

    .question-container {
        padding: 15px;
    }

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

    .answer-btn {
        padding: 15px 20px;
        font-size: 0.8rem;
    }

    .mbti-previous-btn,
    .mbti-next-btn {
        margin-top: 25px;
        padding: 10px 25px;
        font-size: 0.85rem;
    }

    .mbti-type-badge {
        font-size: 2.2rem;
        letter-spacing: 5px;
    }

    .mbti-type-title {
        font-size: 1.1rem;
    }
}

/* MBTI 결과 인포그래픽 스타일 */
.mbti-dimension {
    margin-bottom: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.mbti-dimension:last-child {
    margin-bottom: 0;
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.dimension-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dimension-label.left {
    color: #8b5cf6;
}

.dimension-label.right {
    color: #ec4899;
}

.dimension-label .percent-value {
    color: inherit;
    font-size: 0.85rem;
    font-weight: 700;
}

.dimension-bar-wrapper {
    position: relative;
    height: 20px;
    margin-bottom: 5px;
}

.dimension-bar-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dimension-bar-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dimension-bar-fill.left {
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
}

.dimension-bar-fill.right {
    background: linear-gradient(90deg, #f9a8d4 0%, #ec4899 100%);
}

/* 1번째 차원 (E-I): 보라색 */
.mbti-dimension:nth-child(1) .dimension-bar-fill.left {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%) !important;
}

.mbti-dimension:nth-child(1) .dimension-bar-fill.right {
    background: linear-gradient(90deg, #a78bfa 0%, #c4b5fd 100%) !important;
}

/* 2번째 차원 (S-N): 청록색 */
.mbti-dimension:nth-child(2) .dimension-bar-fill.left {
    background: linear-gradient(90deg, #14b8a6 0%, #2dd4bf 100%) !important;
}

.mbti-dimension:nth-child(2) .dimension-bar-fill.right {
    background: linear-gradient(90deg, #5eead4 0%, #99f6e4 100%) !important;
}

/* 3번째 차원 (T-F): 주황색 */
.mbti-dimension:nth-child(3) .dimension-bar-fill.left {
    background: linear-gradient(90deg, #f59e0b 0%, #fb923c 100%) !important;
}

.mbti-dimension:nth-child(3) .dimension-bar-fill.right {
    background: linear-gradient(90deg, #fbbf24 0%, #fcd34d 100%) !important;
}

/* 4번째 차원 (J-P): 핑크색 */
.mbti-dimension:nth-child(4) .dimension-bar-fill.left {
    background: linear-gradient(90deg, #ec4899 0%, #f472b6 100%) !important;
}

.mbti-dimension:nth-child(4) .dimension-bar-fill.right {
    background: linear-gradient(90deg, #f9a8d4 0%, #fbcfe8 100%) !important;
}

.dimension-center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(-1px);
    z-index: 1;
}

.dimension-percentages {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.percent-value {
    font-size: 0.85rem;
    font-weight: 700;
}

.percent-value.left {
    color: #8b5cf6;
}

.percent-value.right {
    color: #ec4899;
}

/* 인포그래픽 카드 스타일 */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 10px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.card-icon {
    font-size: 1.5rem;
}

.card-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.card-text {
    color: #475569;
    line-height: 1.7;
    font-size: 0.95rem;
    margin: 0;
}

.traits-grid,
.tips-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trait-item,
.tip-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trait-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.tip-item:hover {
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.trait-bullet,
.tip-number {
    color: #8b5cf6;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    line-height: 1;
}

.trait-text,
.tip-text {
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .mbti-dimension {
        padding: 10px;
    }

    .dimension-label {
        font-size: 0.75rem;
    }

    .dimension-bar-wrapper {
        height: 20px;
    }

    .info-card {
        font-size: 0.9rem; 
        padding: 15px;
    }

    .card-icon {
        font-size: 1.2rem;
    }

    .card-header h4 {
        font-size: 0.9rem;
    }

    .trait-item,
    .tip-item {
        padding: 3px;
    }

    .trait-text,
    .tip-text {
        font-size: 0.8rem;
    }
}
