/* ==================================
   테스트 공통 레이아웃
================================== */
.test-container {
    max-width: 650px;
    margin: 60px auto;
    padding: 20px;
    box-sizing: border-box;
}

#test-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    /* 이미지 모서리 둥글게 */
}

/* ==================================
   시작 화면 스타일
================================== */
.test-start-screen {
    text-align: center;
    padding: 0;
}

.start-image {
    width: 100%;
    height: 300px;
    max-height: 400px;
    object-fit: contain;
    object-position: center center;
}

.test-start-screen h1 {
    font-size: 2.2rem;
    color: #000;
    margin: 20px 0 10px 0;
}

.test-start-screen p {
    font-size: 1.1rem;
    color: #555;
    margin: 0 20px 25px 20px;
    line-height: 1.6;
}

.start-btn {
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #8A2BE2;
    /* 메인 테마 색상 */
    color: white;
    padding: 15px 40px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 30px;
}

.start-btn:hover {
    background-color: #6a1fa2;
    transform: translateY(-2px);
}

/* ==================================
   질문 화면 스타일
================================== */
.test-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #eee;
}

.progress {
    width: 0%;
    /* JS가 조작 */
    height: 100%;
    background-color: #8A2BE2;
    transition: width 0.3s ease;
}

.test-question-box {
    padding: 30px;
    text-align: center;
}

.test-question-box h2 {
    font-size: 1.6rem;
    color: #333;
    line-height: 1.5;
    margin: 15px 0 30px 0;
}

.answer-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-btn {
    font-size: 1rem;
    font-weight: 500;
    background-color: #f8f9fa;
    color: #333;
    padding: 18px 20px;
    border: 1px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.answer-btn:hover {
    background-color: #f0e6ff;
    border-color: #8A2BE2;
    color: #000;
}

/* ==================================
   로딩 화면 스타일
================================== */
.test-loading-screen {
    text-align: center;
    padding: 100px 30px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f0e6ff;
    border-top-color: #8A2BE2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.2rem;
    color: #555;
    font-weight: bold;
}

/* ==================================
   결과 페이지 스타일 (바이럴 핵심)
================================== */
.test-result-box {
    padding: 30px;
    text-align: center;
}

.result-badge {
    display: inline-block;
    padding: 8px 15px;
    background: #f0e6ff;
    color: #8A2BE2;
    font-weight: bold;
    border-radius: 20px;
    font-size: 0.9rem;
}

.test-result-box h2 {
    font-size: 2.5rem;
    margin: 15px 0;
    color: #000;
}

.result-img {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
}

.result-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    text-align: left;
    margin-top: 25px;
}

/* 궁합 섹션 */
.compatibility-box {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    border-top: 1px dashed #eee;
    border-bottom: 1px dashed #eee;
    padding: 20px 0;
}

.compatibility-box>div {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
}

.compatibility-box strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 8px;
}

.compatibility-box span {
    font-size: 1.3rem;
    font-weight: bold;
}

.match {
    background-color: #e6f7ff;
    color: #0056b3;
}

.mismatch {
    background-color: #fff0f0;
    color: #d90429;
}

/* 공유 버튼 */
.share-buttons {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.share-btn,
.retry-btn {
    font-size: 1rem;
    font-weight: bold;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    /* 버튼 크기 키움 */
}

.share-btn.link {
    background-color: #9c27b0;
    color: white;
}

.share-btn.link:hover {
    background-color: #7b1fa2;
}

.retry-btn {
    margin-top: 15px;
    background-color: #f0f0f0;
    color: #555;
}

.retry-btn:hover {
    background-color: #e0e0e0;
}

/* ==================================
   테스트 결과 - 출처 스타일
================================== */
.result-source {
    font-size: 0.8rem;
    /* 작은 글씨 크기 */
    color: #888;
    /* 연한 회색 */
    text-align: left;
    /* 왼쪽 정렬 */
    margin-top: 25px;
    /* '다시하기' 버튼과의 간격 */
    padding-top: 15px;
    /* 위쪽 구분선과의 간격 */
    border-top: 1px solid #eee;
    /* 구분선 */
    line-height: 1.5;
    /* 줄 간격 */
    word-break: break-all;
    /* 긴 URL이 깨지지 않도록 */
}

/* ==================================
   모바일 반응형 (600px 이하)
================================== */
@media (max-width: 600px) {

    /* 공통 레이아웃 */
    .test-container {
        margin: 10px auto;
        padding: 0;
    }
    .start-image {
        height: 250px;
        /* 모바일에서는 높이를 조금 줄임 (조절 가능) */
    }

    #test-content {
        border-radius: 0;
        box-shadow: none;
    }

    /* 시작 화면 */
    .test-start-screen h1 {
        font-size: 1.8rem;
    }

    .test-start-screen p {
        font-size: 1rem;
        margin: 0 15px 20px 15px;
    }

    .start-btn {
        font-size: 1rem;
        padding: 12px 30px;
        margin-bottom: 25px;
    }

    /* 질문 화면 */
    .test-question-box {
        padding: 20px;
    }

    .test-question-box h2 {
        font-size: 1.3rem;
        margin: 10px 0 25px 0;
    }

    .answer-btn {
        font-size: 0.95rem;
        padding: 15px;
    }

    /* 로딩 화면 */
    .test-loading-screen {
        padding: 80px 20px;
    }

    /* 결과 화면 */
    .test-result-box {
        padding: 20px;
    }

    .test-result-box h2 {
        font-size: 1.9rem;
        /* 모바일 제목 크기 */
    }

    .result-img {
        max-width: 300px;
    }

    .result-desc {
        font-size: 1rem;
        /* 모바일 설명 크기 */
        text-align: center;
        /* 모바일에서는 중앙 정렬 */
    }

    /* 궁합 섹션 (세로 쌓기) */
    .compatibility-box {
        flex-direction: column;
        /* 세로로 쌓기 */
        gap: 10px;
        padding: 20px 0;
    }

    .compatibility-box>div {
        padding: 12px;
    }

    .compatibility-box span {
        font-size: 1.1rem;
        /* 궁합 이름 폰트 */
    }

    /* 버튼 */
    .share-buttons {
        flex-direction: column;
        /* 세로로 쌓기 */
        gap: 12px;
        margin-top: 25px;
    }

    .share-btn,
    .retry-btn {
        font-size: 1rem;
        padding: 14px 20px;
        /* 터치 영역 확보 */
    }

    .retry-btn {
        margin-top: 8px;
    }

    /* 출처 */
    .result-source {
        font-size: 0.75rem;
        margin-top: 20px;
        padding: 15px 10px 0 10px;
        /* 좌우 여백 추가 */
    }
}