/* 주차접촉사고 테스트 스타일 - 전문적이고 신뢰감 있는 법률/보험 테마 */

:root {
    --primary-color: #1a365d;      /* 진한 네이비 - 신뢰감 */
    --secondary-color: #2d5a87;    /* 미드 블루 */
    --accent-color: #e53e3e;       /* 경고 레드 */
    --success-color: #38a169;      /* 성공 그린 */
    --warning-color: #d69e2e;      /* 주의 오렌지 */
    --background-color: #f7fafc;   /* 밝은 회색 */
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --vh: 1vh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
    background: linear-gradient(135deg, var(--background-color) 0%, #edf2f7 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}

.container {
    max-width: 430px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}

.hidden {
    display: none !important;
}

/* 광고 섹션 */
.ad-section {
    margin: 10px 0 20px 0;
    text-align: center;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* 헤더 스타일 */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.main-icon {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
}

.accent-icon {
    position: absolute;
    top: -10px;
    right: -15px;
    font-size: 1.5rem;
    background: var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    animation: pulse 2s infinite;
}

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

.title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 12px;
    line-height: 1.3;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 특징 카드 */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

.feature {
    background: var(--card-bg);
    padding: 16px 8px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.feature-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 시작 버튼 */
.start-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 30px auto;
    min-width: 280px;
    box-shadow: var(--shadow-lg);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(29, 78, 216, 0.3);
}

.btn-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.start-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* 정보 카드 */
.info-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: auto;
}

.info-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.info-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 진행바 */
.progress-bar {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: relative;
}

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

.progress-text {
    position: absolute;
    top: 16px;
    right: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 질문 스타일 */
.question-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.question-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    line-height: 1.3;
}

.question-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.answers-grid {
    display: grid;
    gap: 12px;
    flex: 1;
}

.answer-option {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.answer-option:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.answer-option.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: scale(0.98);
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.analysis-header h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.analysis-header p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.modal-ad {
    margin: 20px 0;
    padding: 16px;
    background: var(--background-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.analysis-steps {
    margin: 30px 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.step-item:last-child {
    border-bottom: none;
}

.step-icon {
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    background: var(--background-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.step-item.active .step-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
}

.step-text {
    flex: 1;
    text-align: left;
    font-weight: 500;
    color: var(--text-primary);
}

.step-check {
    font-size: 1.2rem;
    color: var(--border-color);
    transition: all 0.3s ease;
}

.timer {
    margin-top: 20px;
}

.timer-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    animation: spin 2s linear infinite;
}

.timer-display {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

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

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

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.result-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.result-summary {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.result-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.result-content h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-content h5 {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 12px;
}

.result-content h6 {
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.result-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

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

.result-content li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

/* 액션 버튼들 */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-buttons button {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.detail-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    grid-column: 1 / -1;
}

.detail-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.share-btn {
    background: #fee500;
    color: #3c1e1e;
}

.other-test-btn {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.restart-btn {
    background: var(--success-color);
    color: white;
    grid-column: 1 / -1;
}

.action-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 반응형 디자인 */
@media (max-width: 390px) {
    .container {
        padding: 16px;
    }
    
    .title {
        font-size: 1.6rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .info-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .detail-btn,
    .restart-btn {
        grid-column: 1;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a202c;
        --card-bg: #2d3748;
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --border-color: #4a5568;
    }
}

/* 상세 처리 방법 모달 스타일 */
.detail-modal {
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.close-btn {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: white;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 24px;
}

.detail-section {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-section h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section ul,
.detail-section ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.detail-section li {
    margin-bottom: 8px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.detail-section li strong {
    color: var(--primary-color);
    font-weight: 600;
}

.checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.checklist label:hover {
    background-color: var(--background-color);
}

.checklist input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.useful-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.useful-links a {
    display: inline-block;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.useful-links a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 광고 컨테이너 스타일 - 새로 추가 */
.ad-container {
    width: 100%;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.ad-container.mid {
    margin: 30px 0;
    border: 1px solid var(--border-color);
}

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

/* 모바일 최적화 */
@media (max-width: 480px) {
    .detail-modal {
        max-width: 95vw;
        margin: 10px;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .checklist {
        grid-template-columns: 1fr;
    }
}
