/* 네이처 테마 기반 유기적 디자인 */
:root {
    --forest-green: #2d5016;
    --leaf-green: #4a7c26;
    --light-green: #7fb069;
    --cream: #f4f3ee;
    --earth-brown: #8b5a3c;
    --warning-orange: #ff6b35;
    --sky-blue: #87ceeb;
    --shadow-green: rgba(45, 80, 22, 0.2);
    --text-dark: #2d3436;
    --text-light: #636e72;
    --vh: 1vh;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, #e8f5e8 100%);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* 자연스러운 배경 패턴 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(122, 176, 105, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 90, 60, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 107, 53, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

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

.hidden {
    display: none !important;
}

/* 광고 섹션 */
.ad-section {
    margin-bottom: 25px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(122, 176, 105, 0.2);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 시작 페이지 */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.header-wrapper {
    text-align: center;
    position: relative;
}

.warning-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(45deg, var(--warning-orange), #ff8c42);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    animation: pulse-warning 2s infinite;
}

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

.main-title {
    font-size: 2.8em;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 15px;
    color: var(--forest-green);
}

.highlight {
    background: linear-gradient(45deg, var(--leaf-green), var(--light-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.subtitle {
    font-size: 1.2em;
    color: var(--text-light);
    margin-bottom: 10px;
}

/* 팩트 카드들 */
.facts-preview {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.fact-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(122, 176, 105, 0.2);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.fact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(122, 176, 105, 0.1), transparent);
    transition: left 0.5s ease;
}

.fact-card:hover::before {
    left: 100%;
}

.fact-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px var(--shadow-green);
    border-color: var(--light-green);
}

.fact-icon {
    font-size: 2.5em;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, var(--light-green), var(--leaf-green));
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 15px rgba(122, 176, 105, 0.3);
}

.fact-text h3 {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--forest-green);
    margin-bottom: 5px;
}

.fact-text p {
    color: var(--text-light);
    font-size: 0.95em;
}

/* 퀴즈 소개 */
.quiz-intro {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 30px;
    text-align: center;
    border: 2px solid rgba(122, 176, 105, 0.3);
    position: relative;
}

.quiz-intro::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--light-green), var(--leaf-green), var(--light-green));
    border-radius: 25px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-intro:hover::after {
    opacity: 0.3;
}

.quiz-header h2 {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--forest-green);
    margin-bottom: 10px;
}

.quiz-header p {
    color: var(--text-light);
    font-size: 1.1em;
    margin-bottom: 25px;
}

.quiz-details {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px 0;
    border-top: 1px solid rgba(122, 176, 105, 0.2);
    border-bottom: 1px solid rgba(122, 176, 105, 0.2);
}

.detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    color: var(--text-dark);
}

.detail-icon {
    font-size: 1.8em;
    color: var(--leaf-green);
}

/* 시작 버튼 */
.start-button {
    background: linear-gradient(45deg, var(--leaf-green), var(--light-green));
    border: none;
    border-radius: 50px;
    padding: 18px 35px;
    font-size: 1.1em;
    font-weight: 700;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(122, 176, 105, 0.4);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.start-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.start-button:hover::before {
    left: 100%;
}

.start-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(122, 176, 105, 0.5);
}

.button-arrow {
    font-size: 1.3em;
    transition: transform 0.3s ease;
}

.start-button:hover .button-arrow {
    transform: translateX(5px);
}

/* 주의사항 */
.warning-notice {
    background: linear-gradient(45deg, rgba(255, 107, 53, 0.1), rgba(255, 140, 66, 0.05));
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 20px;
    padding: 25px;
    border-left: 5px solid var(--warning-orange);
}

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

.notice-icon {
    font-size: 1.5em;
}

.notice-title {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--warning-orange);
}

.notice-list {
    list-style: none;
    color: var(--text-dark);
    line-height: 1.8;
}

.notice-list li {
    margin: 8px 0;
    font-size: 0.95em;
}

/* 질문 페이지 */
.question-header {
    margin-bottom: 35px;
}

.progress-section {
    margin-bottom: 30px;
}

.progress-info {
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    color: var(--forest-green);
    margin-bottom: 15px;
}

.progress-track {
    background: rgba(122, 176, 105, 0.2);
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, var(--leaf-green), var(--light-green));
    height: 100%;
    width: 0%;
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.question-text {
    font-size: 1.6em;
    font-weight: 700;
    text-align: center;
    color: var(--forest-green);
    line-height: 1.4;
}

/* 옵션 컨테이너 */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.option-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(122, 176, 105, 0.2);
    border-radius: 20px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
}

.option-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(122, 176, 105, 0.1), transparent);
    transition: left 0.4s ease;
}

.option-item:hover::before {
    left: 100%;
}

.option-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--light-green);
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-green);
}

.option-item.selected {
    background: linear-gradient(45deg, var(--light-green), var(--leaf-green));
    border-color: var(--leaf-green);
    color: white;
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(122, 176, 105, 0.4);
}

.question-hint {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9em;
    font-style: italic;
    padding: 15px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    border: 1px solid rgba(122, 176, 105, 0.2);
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 80, 22, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--cream);
    border-radius: 25px;
    padding: 35px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    position: relative;
    border: 2px solid rgba(122, 176, 105, 0.3);
    box-shadow: 0 20px 60px rgba(45, 80, 22, 0.3);
}

.analysis-animation {
    margin-bottom: 30px;
}

.car-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.loading-text {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--forest-green);
    margin-bottom: 20px;
}

.loading-bar {
    background: rgba(122, 176, 105, 0.2);
    height: 8px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

.loading-progress {
    background: linear-gradient(90deg, var(--leaf-green), var(--light-green));
    height: 100%;
    width: 0%;
    border-radius: 8px;
    animation: loading 3s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.analysis-steps {
    text-align: left;
    margin-bottom: 25px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(122, 176, 105, 0.2);
}

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

.step-icon {
    font-size: 1.3em;
    width: 30px;
    text-align: center;
}

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

.step-status {
    font-size: 0.8em;
    padding: 4px 8px;
    border-radius: 10px;
    background: var(--light-green);
    color: white;
}

.countdown {
    margin-bottom: 20px;
}

.countdown-text {
    color: var(--text-light);
    margin-bottom: 8px;
}

.countdown-number {
    font-size: 2.5em;
    font-weight: 800;
    color: var(--warning-orange);
}

.popup-ad {
    margin-top: 25px;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    min-height: 120px;
    border: 1px solid rgba(122, 176, 105, 0.2);
}

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

.result-badge {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: white;
    box-shadow: 0 10px 30px var(--shadow-green);
}

.result-title {
    font-size: 2em;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--forest-green);
}

.result-subtitle {
    font-size: 1.2em;
    color: var(--text-light);
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 35px;
}

/* 액션 섹션 */
.action-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.primary-action, .other-test-btn, .share-button, .retry-button {
    padding: 16px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.primary-action {
    background: linear-gradient(45deg, var(--leaf-green), var(--light-green));
    color: white;
}

.other-test-btn {
    background: linear-gradient(45deg, var(--earth-brown), var(--warning-orange));
    color: white;
}

.share-button {
    background: #FEE500;
    color: #3C1E1E;
}

.retry-button {
    background: rgba(255, 255, 255, 0.8);
    color: var(--forest-green);
    border: 2px solid rgba(122, 176, 105, 0.3);
}

.primary-action:hover, .other-test-btn:hover, .share-button:hover, .retry-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-green);
}

/* 반응형 디자인 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2.3em;
    }
    
    .facts-preview {
        gap: 12px;
    }
    
    .fact-card {
        padding: 15px;
    }
    
    .quiz-details {
        flex-direction: column;
        gap: 15px;
    }
    
    .detail {
        flex-direction: row;
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .main-title {
        font-size: 2em;
    }
    
    .container {
        padding: 12px;
    }
}

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

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

.ad-container.mid {
    margin: 30px 0;
    background: rgba(244, 243, 238, 0.9);
}

.ad-container.result {
    margin: 30px 0 20px 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(232, 245, 232, 0.9) 100%);
}

.ad-container ins {
    display: block !important;
}

/* 광고 로딩 상태 */
.ad-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ad-container.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 모바일 광고 최적화 */
@media (max-width: 480px) {
    .ad-container {
        margin: 15px 0;
        padding: 8px;
    }
    
    .ad-container.top {
        margin-bottom: 20px;
    }
    
    .ad-container.mid {
        margin: 20px 0;
    }
}
