/* 별자리 궁합 테스트 - 스타일시트 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #7b2cbf;
    --primary-light: #9d4edd;
    --primary-dark: #5a189a;
    --accent-color: #f72585;
    --text-light: #ffffff;
    --text-dark: #333333;
    --bg-dark: #10002b;
    --bg-card: rgba(78, 46, 131, 0.7);
    --bg-light: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--text-light);
    background: var(--bg-dark);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 별 배경 효과 */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom, #0c0023, #190061, #3500d3);
    overflow: hidden;
}

.stars-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 10px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 5px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 10px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    animation: starsAnimation 200s linear infinite;
}

@keyframes starsAnimation {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

/* 컨테이너 및 섹션 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    opacity: 0.9;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 선택 섹션 */
#selection-section {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.selection-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.selection-group {
    flex: 1 1 300px;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
    font-size: 1.1rem;
}

.custom-select {
    position: relative;
}

select {
    appearance: none;
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    background-color: var(--bg-light);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

/* select 옵션의 배경색과 텍스트 색상 수정 */
select option {
    background-color: var(--bg-dark);  /* 어두운 배경색 사용 */
    color: var(--text-light);          /* 밝은 텍스트 색상 사용 */
}

/* 드롭다운 열릴 때의 스타일 */
select:focus {
    background-color: var(--bg-dark);
    color: var(--text-light);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* 버튼 스타일 */
.btn-primary {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 2rem auto 0;
    padding: 0.8rem;
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-light);
    color: var(--text-light);
}

/* 접근성 포커스 스타일 추가 */
button:focus, select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* 키보드 사용자를 위한 포커스 스타일 */
button:focus-visible, select:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* 결과 섹션 */
#result-section {
    width: 100%;
    max-width: 800px;
}

.result-header {
    background: var(--bg-card);
    border-radius: 15px 15px 0 0;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zodiac-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-direction: row; /* 명시적으로 가로 방향 지정 */
}

.zodiac-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.zodiac-icon img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-light);
    padding: 0.5rem;
    object-fit: contain;
}

.compatibility-heart {
    font-size: 1.8rem;
    color: var(--accent-color);
    animation: pulse 1.5s infinite;
    margin: 0 1rem; /* 양쪽에 여백 추가 */
}

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

#compatibility-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

#compatibility-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.compatibility-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.score-bar {
    width: 100%;
    max-width: 300px;
    height: 12px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
}

#score-fill {
    height: 100%;
    background: linear-gradient(to right, #f72585, #7209b7);
    transition: width 1.5s ease-out;
    width: 0%;
}

.score-number {
    font-size: 1.2rem;
    font-weight: 500;
}

#score-value {
    color: #f72585;
    font-weight: 700;
    font-size: 1.4rem;
}

.result-body {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 0 0 15px 15px;
    box-shadow: var(--shadow);
}

.topic-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.topic-card {
    background: var(--bg-light);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.topic-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--primary-light);
}

.keywords-container, .advice-container {
    margin-top: 2rem;
}

.keywords-container h3, .advice-container h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--primary-light);
}

#keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.keyword-tag {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
}

/* 유틸리티 클래스 */
.hidden {
    display: none;
}

/* 푸터 */
footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem 0;
    opacity: 0.7;
    font-size: 0.9rem;
}

.footer-nav {
    margin-bottom: 1.5rem;
    text-align: center;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;  /* 공간이 부족하면 줄바꿈 */
    justify-content: center;
    gap: 1rem 1.5rem;  /* 세로 1rem, 가로 1.5rem 간격 */
    list-style-type: none;
    padding: 0;
    margin: 0 auto;
}

.footer-nav li {
    display: inline-block;  /* 인라인 블록으로 설정 */
}

.footer-nav a {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
    opacity: 0.8;
    font-size: 0.95rem;
    padding: 0.2rem 0;
}

.footer-nav a:hover, 
.footer-nav a:focus {
    border-bottom: 1px solid var(--primary-light);
    opacity: 1;
    color: var(--primary-light);
}

/* 화면 크기에 따른 반응형 조정 */
@media (max-width: 600px) {
    .footer-nav ul {
        gap: 0.8rem 1.2rem;  /* 더 작은 화면에서는 간격 줄임 */
    }
    
    .footer-nav a {
        font-size: 0.85rem;  /* 더 작은 화면에서 글자 크기 조정 */
    }
}

.disclaimer {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}


/* 애니메이션 */
.animate__animated {
    animation-duration: 0.8s;
}

/* 로딩 인디케이터 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 0, 43, 0.8);
    z-index: 100;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 반응형 미디어 쿼리 */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .selection-container {
        flex-direction: column;
    }
    
    .selection-group {
        flex: 1 1 100%;
    }
    
    .topic-cards {
        grid-template-columns: 1fr;
    }
    
   /* 수직 배열을 수평 배열로 하기 위해 주석처리
    .zodiac-icons {
        flex-direction: column;
    }
    
    .compatibility-heart {
        margin: 0.5rem 0;
    }   
    */
    
    /* 모바일에서의 스크롤 개선 */
    body {
        -webkit-overflow-scrolling: touch;
    }
}

/* 별자리 아이콘 추가 */
.zodiac-icon img {
    background: rgba(255, 255, 255, 0.1);
}
