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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 페이지 공통 */
.page {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* 시작 페이지 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.main-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    display: block;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 20px;
}

/* 기능 섹션 */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
}

/* 버튼 스타일 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 160px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.6);
}

.btn-icon {
    font-size: 1.1rem;
}

/* 테스트 정보 */
.test-info {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 15px;
    margin-top: 20px;
}

.test-info p {
    color: #059669;
    font-weight: 500;
    margin: 0;
}

/* 진행률 바 */
.progress-container {
    margin-bottom: 30px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.question-number {
    text-align: center;
    color: #6b7280;
    font-weight: 500;
}

/* 질문 카드 */
.question-card {
    text-align: center;
}

.question-card h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 30px;
    line-height: 1.4;
}

/* 답변 옵션 */
.answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-option {
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e5e7eb;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.answer-option:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.answer-option.selected {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #1d4ed8;
    color: white;
}

.answer-emoji {
    font-size: 1.5rem;
    margin-right: 12px;
}

.answer-text {
    font-weight: 500;
    font-size: 1rem;
}

/* 결과 페이지 */
.result-header {
    text-align: center;
    margin-bottom: 30px;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.result-header h2 {
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 10px;
}

.result-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 20px;
}

.result-description {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 4px solid #0ea5e9;
}

.tips-section {
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #f59e0b;
}

.tips-section h3 {
    color: #92400e;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.tips-section ul {
    list-style: none;
    padding: 0;
}

.tips-section li {
    background: rgba(255, 255, 255, 0.6);
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    position: relative;
    padding-left: 35px;
}

.tips-section li::before {
    content: "💡";
    position: absolute;
    left: 10px;
    top: 10px;
}

/* 광고 섹션 - 수정된 스타일 */
.ad-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ad-container.top {
    margin-bottom: 30px;
}

.ad-container.mid {
    margin: 30px auto;
    border: 1px solid #e0e0e0;
}

.ad-container.result {
    margin: 30px auto;
    background: rgba(247, 250, 252, 0.95);
}

.ad-container.bottom {
    margin-top: 30px;
}

/* 팝업 오버레이 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
}

/* 분석 팝업 */
.analysis-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.popup-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    min-width: 320px;
}

.analysis-header {
    margin-bottom: 20px;
}

.analysis-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.analysis-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 10px;
}

.countdown {
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: countdown 1s infinite;
}

@keyframes countdown {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.popup-ad-container {
    margin: 20px 0;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-ad {
    border-radius: 10px;
    overflow: hidden;
}

.confirm-popup-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    min-width: 160px;
}

.confirm-popup-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
}

.confirm-popup-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* 결과 섹션 스타일 */
.result-section {
    margin: 20px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
}

.result-section h3 {
    color: #1e40af;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.result-section h4 {
    color: #374151;
    margin: 10px 0 5px 0;
    font-size: 1em;
}

.result-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.result-section li {
    margin: 5px 0;
    line-height: 1.5;
}

/* 카드 추천 섹션 */
.card-recommendations {
    display: grid;
    gap: 15px;
    margin: 15px 0;
}

.card-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-item h4 {
    color: #1f2937;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-item p {
    margin: 0;
    line-height: 1.6;
    font-size: 0.9em;
}

.card-item a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.card-item a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .page {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        gap: 10px;
    }
    
    .ad-popup-content {
        width: 95%;
        padding: 20px;
    }
    
    .card-recommendations {
        grid-template-columns: 1fr;
    }
    
    .result-section {
        padding: 12px;
        margin: 15px 0;
    }
    
    .card-item {
        padding: 10px;
    }
    
    .result-section h3 {
        font-size: 1em;
    }
    
    .card-item h4 {
        font-size: 0.9em;
    }
}
