/* --- Modern & Sophisticated Palm Reading Test Styles --- */

:root {
    --bg-dark: #0d1120;
    --primary-accent: #8e44ad;
    --secondary-accent: #3498db;
    --text-light: #ecf0f1;
    --text-medium: #bdc3c7;
    --text-dark: #2c3e50;
    --glass-bg: rgba(22, 28, 48, 0.5);
    --glass-border: rgba(142, 68, 173, 0.3);
    --glow-color: rgba(142, 68, 173, 0.5);
    --gradient-primary: linear-gradient(135deg, #8e44ad 0%, #3498db 100%);
    --font-main: 'Poppins', 'Noto Sans KR', sans-serif;
    --border-radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.7;
    overflow-x: hidden;
    background-image: url('https://images.unsplash.com/photo-1531315639943-d3a777a83353?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1974&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 32, 0.8);
    backdrop-filter: blur(5px);
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 20px;
}

/* --- Navigation --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}
.nav-brand:hover {
    color: var(--primary-accent);
}
.nav-brand i {
    color: var(--primary-accent);
    font-size: 1.5rem;
}
.nav-menu { display: flex; gap: 0.5rem; }
.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-light);
    background: rgba(142, 68, 173, 0.2);
}
.nav-toggle { display: none; }


/* --- Header --- */
.header {
    text-align: center;
    margin: 2rem 0 3rem 0;
}
.main-title {
    font-size: 2.8rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
.subtitle {
    font-size: 1.1rem;
    color: var(--text-medium);
    max-width: 600px;
    margin: 0 auto;
}

/* --- Cards --- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}
.card-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}
.card-header h2 i { color: var(--primary-accent); margin-right: 0.5rem; }
.card-header p { color: var(--text-medium); }


/* --- Upload Area --- */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: var(--border-radius);
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-accent);
    background: rgba(142, 68, 173, 0.1);
}
.upload-icon {
    font-size: 3.5rem;
    color: var(--primary-accent);
    margin-bottom: 1rem;
}
.upload-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.upload-hint { color: var(--text-medium); }

.privacy-notice {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-medium);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}
.privacy-notice i { color: #27ae60; }

/* --- Image Preview & Buttons --- */
.image-preview-section { display: none; }
.image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    margin: 1rem auto;
    display: block;
    border: 2px solid var(--glass-border);
}
.button-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.btn {
    padding: 0.8rem 1.8rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn i { transition: transform 0.3s ease; }
.btn:hover i { transform: scale(1.2); }
.btn-primary {
    background: var(--gradient-primary);
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 0 20px var(--glow-color);
}
.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--text-light);
}

/* --- Analysis Result --- */
.analysis-result { display: none; }
.fortune-report {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    animation: fadeIn 0.5s ease-in-out;
}
.report-header {
    text-align: center;
    margin-bottom: 2rem;
}
.report-header .icon {
    font-size: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
.report-header h2 { font-size: 2rem; color: var(--text-light); }

.fortune-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}
.fortune-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.fortune-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-accent);
    margin-bottom: 0.5rem;
}
.fortune-value {
    font-size: 1rem;
    color: var(--text-medium);
    padding-left: 2.2rem;
    line-height: 1.8;
}
.lucky-number-section {
    text-align: center;
    margin-top: 2rem;
    background: rgba(142, 68, 173, 0.1);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}
.lucky-number-section .fortune-label { justify-content: center; }
.lucky-numbers { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1rem; }
.lucky-number {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 50%;
    box-shadow: 0 0 15px var(--glow-color);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Info Section --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.info-item h3 {
    color: var(--secondary-accent);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}
.info-item h3 i { margin-right: 0.5rem; }
.info-item p { color: var(--text-medium); font-size: 0.95rem; }

/* --- Footer --- */
.footer {
    background: rgba(13, 17, 32, 0.8);
    border-top: 1px solid var(--glass-border);
    padding: 3rem 2rem 2rem 2rem;
    margin-top: 3rem;
    color: var(--text-medium);
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-section h4 {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 0.5rem; }
.footer-section a {
    color: var(--text-medium);
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-section a:hover { color: var(--primary-accent); }
.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
    font-size: 0.9rem;
}


/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 32, 0.7);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
}
.modal-content {
    text-align: center;
    color: var(--text-light);
}
.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(142, 68, 173, 0.3);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .main-title { font-size: 2.2rem; }
    .nav-container { padding: 0 1rem; }
    .info-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: flex; flex-direction: column; cursor: pointer; }
    .nav-toggle span { width: 25px; height: 2px; background: var(--text-light); margin: 3px 0; transition: all 0.3s ease; }
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
    }
    .nav-menu.active { left: 0; }
    .card { padding: 1.5rem; }
    .fortune-report { padding: 1.5rem; }
}

.analysis-result {
    display: flex; /* Flexbox 레이아웃 사용 */
    justify-content: center; /* 자식 요소를 가로축 중앙에 배치 */
    align-items: center; /* 자식 요소를 세로축 중앙에 배치 */
    padding: 2rem 0; /* 위아래 여백 추가 */
}
/*
.fortune-report {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    animation: fadeIn 0.5s ease-in-out;
    width: 100%; /* 부모 너비에 맞춤 */
    max-width: 550px; /* 카드의 최대 너비를 지정해 너무 커지는 것을 방지 */
}
*/
/* 행운 번호 섹션 스타일 */
.lucky-number-section {
    text-align: center;
    margin-top: 2rem;
    background: rgba(142, 68, 173, 0.1);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.lucky-number-section .fortune-label {
    justify-content: center; /* 라벨 텍스트도 중앙 정렬 */
}

/* 행운 번호들을 감싸는 컨테이너 */
.lucky-numbers {
    display: flex; /* ✨ 핵심: 번호들을 가로로 나열 */
    justify-content: center; /* 번호들을 중앙에 배치 */
    flex-wrap: wrap; /* 화면이 좁아지면 줄바꿈 */
    gap: 0.75rem; /* 번호 사이의 간격 */
    margin-top: 1rem;
}

/* 개별 행운 번호 스타일 */
.lucky-number {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 50%;
    box-shadow: 0 0 15px var(--glow-color);
}