/* style.css /

/* 기본 폰트 및 배경 설정 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #333;
    min-height: 100vh;
    padding: 15px;
    overflow-x: hidden;
    position: relative;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 부유 요소들 */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.float-element {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 20px;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    min-height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

/* 반응형 - 태블릿/데스크톱 */
@media (min-width: 768px) {
    body { padding: 20px; }
    .container {
        max-width: 500px;
        padding: 40px;
        min-height: calc(100vh - 40px);
    }
    .float-element { font-size: 2.5rem; }
}

@media (min-width: 1024px) {
    .container { max-width: 600px; }
    .float-element { font-size: 3rem; }
}

/* 모바일 세로 모드 최적화 */
@media (max-width: 480px) and (orientation: portrait) {
    body { padding: 10px; }
    .container { 
        padding: 15px;
        border-radius: 20px;
        min-height: calc(100vh - 20px);
    }
}

.page {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ===== 시작 페이지 스타일 ===== */
#start-page {
    position: relative;
    overflow: hidden;
}

.hero-section {
    position: relative;
    z-index: 1;
}

.main-title {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1, #FF6B6B);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
    margin-bottom: 20px;
    line-height: 1.1;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: 500;
    opacity: 0.9;
}

/* [수정된 부분 시작] */
.feature-cards {
    display: grid;
    /* 모든 화면 크기에서 항상 3칸으로 나눔 */
    grid-template-columns: repeat(3, 1fr);
    /* 카드 사이 간격을 살짝 줄여 모바일에서 보기 좋게 함 */
    gap: 10px;
    margin-bottom: 30px;
}

.feature-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
    /* 모바일에서 카드 내부 여백 조정 */
    padding: 15px 8px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}
/* [수정된 부분 끝] */


.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, rgba(255,255,255,1), rgba(255,255,255,0.8));
}

.feature-card .icon {
    font-size: 2rem; /* 모바일에서 아이콘 크기 살짝 줄임 */
    margin-bottom: 10px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.feature-card .title {
    font-size: 0.9rem; /* 모바일에서 제목 크기 살짝 줄임 */
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.feature-card .desc {
    font-size: 0.75rem; /* 모바일에서 설명 크기 살짝 줄임 */
    color: #666;
    line-height: 1.4;
}

.stats-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 0;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, #ddd, transparent);
}

/* 버튼 스타일 */
.btn-start, .btn-restart {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 18px 35px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-start::before, .btn-restart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.btn-start:hover::before, .btn-restart:hover::before {
    left: 100%;
}

.btn-start:hover, .btn-restart:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.6);
}

.btn-start:active, .btn-restart:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    min-width: 150px;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.disclaimer {
    font-size: 0.85rem;
    color: #888;
    margin-top: 15px;
    font-style: italic;
}

/* ===== 질문 페이지 스타일 ===== */
.progress-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#question-num {
    font-size: 1.1rem;
    color: #4ECDC4;
    font-weight: 700;
}

.time-estimate {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 14px;
    background: linear-gradient(90deg, #f5f5f5, #eeeeee);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4ECDC4, #44A08D, #4ECDC4);
    background-size: 200% 100%;
    animation: progressShimmer 2s linear infinite;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.4);
}

@keyframes progressShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.question-header {
    margin-bottom: 35px;
}

#question-title {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    margin: 0;
    line-height: 1.4;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.answer-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-answer {
    width: 100%;
    padding: 22px 20px;
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    border: 2px solid rgba(78, 205, 196, 0.2);
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.btn-answer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-answer:hover {
    transform: translateX(8px);
    border-color: #4ECDC4;
    color: white;
    box-shadow: 0 12px 30px rgba(78, 205, 196, 0.3);
    font-weight: 600;
}

.btn-answer:hover::before {
    left: 0;
    opacity: 1;
}

.btn-answer:active {
    transform: translateX(4px) scale(0.98);
}

/* ===== 결과 페이지 스타일 ===== */
#result-page h1 {
    font-size: clamp(2rem, 6vw, 2.8rem);
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    font-weight: 800;
    text-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.result-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.85));
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.4);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.result-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.result-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 3px solid #4ECDC4;
    padding-bottom: 10px;
}

.result-summary {
    text-align: center;
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
    color: white;
}

.result-summary h3 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.score-circle {
    width: 120px;
    height: 120px;
    border: 8px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255,255,255,0.3), transparent, rgba(255,255,255,0.3));
    z-index: -1;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 1rem;
    opacity: 0.8;
    margin-top: -5px;
}

#result-score-text {
    font-size: 1.8rem;
    margin: 15px 0 10px 0;
    font-weight: 700;
}

#result-message {
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* 차트 스타일 */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.chart-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

#result-type-title {
    text-align: center;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0;
    font-weight: 800;
    line-height: 1.2;
}

#result-type-desc, #result-prescription-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #444;
}

#result-prescription-content {
    background: linear-gradient(135deg, rgba(255,107,107,0.1), rgba(78,205,196,0.1));
    padding: 20px;
    border-radius: 15px;
    border-left: 4px solid #4ECDC4;
}

/* 이전에 추가한 링크 스타일 클래스 */
.link-style {
    color: #4ECDC4;
    font-weight: 700;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.link-style:hover {
    color: #44A08D;
    border-bottom-color: #44A08D;
}


.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* 로딩 및 애니메이션 효과 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 모바일 세부 최적화 */
@media (max-width: 480px) {
    /* [수정] 이 부분에서 feature-cards 관련 내용을 제거했습니다. */
    
    .stats-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-divider {
        width: 50px;
        height: 1px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-secondary, .btn-restart {
        width: 100%;
        max-width: 280px;
    }
    
    .chart-container {
        height: 250px;
        padding: 15px;
    }
    
    .chart-legend {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .coupang-ad-container {
    /* 모바일에서 가로 스크롤이 생기지 않도록 함 */
        max-width: 100%;
        overflow-x: hidden;

    /* 배너를 가운데 정렬 */
        margin: 30px auto; /* 위아래 30px 여백, 좌우는 자동으로 중앙에 */

    /* 배너 자체를 가운데 오게 함 */
        display: flex;
        justify-content: center;
    }
}

/* ===== 공유 카드 스타일 (새로 추가) ===== */
#share-card {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#share-card.show {
    opacity: 1;
    pointer-events: auto;
}

.share-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.share-modal {
    background: #f9f9f9;
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#share-card.show .share-modal {
    transform: scale(1);
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.share-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #aaa;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333;
}

/* 공유 카드 미리보기 스타일 */
.share-card-preview {
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    aspect-ratio: 1 / 1; /* 정사각형 비율 유지 */
}

.card-gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.card-content {
    background: rgba(255, 255, 255, 0.95);
    width: 100%;
    height: 100%;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    text-align: center;
    /* [수정] 요소 간 간격을 균등하게 조정 */
    justify-content: space-around; 
}

.card-logo {
    font-weight: 700;
    color: #FF6B6B;
    /* [추가] 아래쪽 여백을 주어 확실히 분리 */
    margin-bottom: 5px; 
}

.card-score-section {
    /* [제거] 겹침의 원인이었던 마이너스 마진 제거 */
    /* margin-top: -20px; */
}

.card-score {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 5px;
    line-height: 1;
}

.card-score-unit {
    font-size: 1rem;
    font-weight: normal;
    margin-left: 2px;
    margin-top: 8px;
}

.card-result-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

.card-type-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FF6B6B;
    line-height: 1.3;
}

.card-footer {
    font-size: 0.75rem;
}
.card-url { color: #888; }
.card-cta { font-weight: 600; color: #4ECDC4; }


/* 공유 버튼 스타일 */
.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn .btn-icon {
    font-size: 1.2rem;
}

.download-btn {
    background-color: #4ECDC4;
    color: white;
}
.download-btn:hover { background-color: #44A08D; }

.copy-btn {
    background-color: #f0f0f0;
    color: #333;
}
.copy-btn:hover { background-color: #e0e0e0; }

.native-share-btn {
    grid-column: 1 / -1; /* 버튼이 3개일 때 전체 너비 차지 */
    background-color: #5a67d8;
    color: white;
}
.native-share-btn:hover { background-color: #4c51bf; }

/* 토스트 메시지 스타일 */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 0.9rem;
    z-index: 2000;
    transition: bottom 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.toast.show {
    bottom: 30px;
}