@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700;900&display=swap');

:root {
    --primary-color: #4a90e2;
    --background-color: #f0f2f5;
    --text-color: #333;
    --card-bg: #ffffff;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    flex-direction: column; /* 이 줄을 추가해주세요 */
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.container {
    max-width: 400px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 30px;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.cta-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.hair-color-btn, .upload-btn {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 2px solid #ddd;
    padding: 15px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.hair-color-btn:hover, .upload-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.guide-img {
    width: 350px;
    margin-bottom: 20px;
}
.guide-text {
    color: #666;
    line-height: 1.5;
    margin-bottom: 30px;
}

/* 로딩 애니메이션 */
.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#loading-text {
    font-size: 1rem;
    color: #555;
    padding: 0 20px;
}

/* 결과 페이지 */
.score {
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin: 10px 0 20px;
}

.result-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    margin-bottom: 30px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}


#result-grade {
    font-size: 1.8rem;
    margin: 0 0 12px;
    white-space: pre-wrap; /* 이 줄을 추가해주세요 */
}

#result-image {
    max-width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
}

#result-quote {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px;
    padding: 10px;
    background-color: #f8f8f8;
    border-left: 4px solid var(--primary-color);
    white-space: pre-wrap;
}

#result-comment {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap; /* 이 줄을 추가해주세요 */
}

.share-btn {
    animation: pulse 2s infinite;
    white-space: nowrap; 
}

/* 광고 컨테이너 스타일 */
.ad-container {
    display:flex;
    justify-content: center;
    align-items: center;
    width: 320px; /* 광고 너비(data-ad-width)와 일치 */
    height: 100px; /* 광고 높이(data-ad-height)와 일치 */
    margin: 30px auto 0; /* 위쪽 여백, 좌우는 자동으로 가운데 정렬 */
    background-color: #d7d7d7;
}


/* 세로 광고 컨테이너 스타일 */
.ad-container-vertical {
    display: none; /* 모바일에서는 숨김 */
    position: fixed;
    left: 20px;
    top: 50%;
    justify-content: center;
    align-items: center;
    transform: translateY(-50%);
    width: 160px; /* 광고 너비와 일치 */
    height: 600px; /* 광고 높이와 일치 */
    background-color: #d7d7d7;
}

/* 화면 너비가 1000px 이상일 때만 세로 광고를 표시 */
@media (min-width: 1000px) {
    .ad-container-vertical {
        display: flex; /* block 또는 flex로 보이게 함 */
    }
}
.hidden {
    display: none !important;
}

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

/* 푸터 스타일 */
footer {
    width: 100%;
    text-align: center; /* 텍스트 가운데 정렬 */
    padding: 20px 0;    /* 위아래 여백 */
    margin-top: 40px;   /* 본문과의 간격 */
    font-size: 0.8rem;  /* 글씨 작게 */
    color: #aaa;        /* 흐린 회색 글씨 */
}

/* 푸터 안의 링크 스타일 */
footer a {
    color: inherit; /* 부모(footer)의 글씨 색상과 동일하게 */
    text-decoration: none; /* 밑줄 없애기 */
}

/* 푸터 안의 링크에 마우스를 올렸을 때 */
footer a:hover {
    text-decoration: underline; /* 마우스를 올리면 밑줄 표시 */
}