/**
 * 사주살롱 공통 컴포넌트 스타일
 * 모든 v2 페이지에서 공통으로 사용하는 컴포넌트 스타일
 *
 * 사용법:
 * <link rel="stylesheet" href="css/variables.css">
 * <link rel="stylesheet" href="css/common-components.css">
 */

/* ============================================
   1. 기본 리셋 및 Body 스타일
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body, 'Pretendard', 'Noto Sans KR', sans-serif);
    background: var(--bg-main, #F8F9FC);
    min-height: 100vh;
    color: var(--text-primary, #1F2937);
    padding-top: 56px;
    transition: background 0.3s ease, color 0.3s ease;
}

html {
    overflow-y: scroll;
    height: 100%;
}

/* ============================================
   2. 네비게이션 바
   ============================================ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-top));
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light, #E5E7EB);
    display: flex;
    align-items: center;
    padding-top: env(safe-area-inset-top);
    padding-left: 16px;
    padding-right: 16px;
    z-index: 1000;
    transition: background 0.3s ease, border-color 0.3s ease;
}

html.dark .top-nav {
    background: rgba(26, 27, 46, 0.95);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.nav-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--primary, #8B5CF6);
    border-radius: 12px;
    color: var(--primary, #8B5CF6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-home-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-2px);
}

.nav-home-btn .material-symbols-outlined {
    font-size: 20px;
}

/* ============================================
   3. 화면 전환 시스템
   ============================================ */
.screen {
    display: none !important;
}

.screen.active {
    display: flex !important;
    flex-direction: column;
}

/* 페이드인 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.screen.active {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   4. 공통 레이아웃
   ============================================ */
.container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* 입력 화면 공통 */
#inputScreen,
.input-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 56px);
    padding: 20px 20px 60px;
}

.input-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
}

/* ============================================
   5. 공통 카드 스타일
   ============================================ */
.card {
    background: var(--bg-card, #FFFFFF);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-card, 0 4px 20px rgba(139, 92, 246, 0.08));
    border: 1px solid var(--border-light, #E5E7EB);
    margin-bottom: 20px;
}

html.dark .card {
    background: var(--bg-card, rgba(30, 32, 50, 0.8));
    border: 1px solid var(--border-card, rgba(139, 92, 246, 0.15));
}

.input-section {
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-light, #E5E7EB);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card, 0 4px 16px rgba(0, 0, 0, 0.06));
}

html.dark .input-section {
    background: var(--bg-card, rgba(30, 32, 50, 0.8));
    border: 1px solid var(--border-card, rgba(139, 92, 246, 0.15));
}

/* ============================================
   6. 공통 타이포그래피
   ============================================ */
.title,
.main-title {
    font-family: var(--font-title, 'Noto Serif KR', serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary, #8B5CF6);
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.4;
}

.subtitle,
.main-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary, #6B7280);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 그라디언트 텍스트 */
.text-gradient,
.gradient-text {
    background: var(--primary-gradient, linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   7. 공통 폼 요소
   ============================================ */
.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1F2937);
    margin-bottom: 10px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.875rem;
    font-family: var(--font-body, 'Pretendard', 'Noto Sans KR', sans-serif);
    background: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-input, #D1D5DB);
    border-radius: 12px;
    color: var(--text-primary, #1F2937);
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary, #8B5CF6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

html.dark .form-input,
html.dark .form-select {
    background: rgba(30, 32, 50, 0.6);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--text-primary, #F5F5F5);
}

/* ============================================
   8. 공통 버튼
   ============================================ */
.btn-primary,
.primary-btn,
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    background: var(--primary-gradient, linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-button, 0 4px 15px rgba(139, 92, 246, 0.3));
}

.btn-primary:hover,
.primary-btn:hover,
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

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

.btn-secondary,
.secondary-btn {
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    background: transparent;
    color: var(--primary, #8B5CF6);
    border: 2px solid var(--primary, #8B5CF6);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover,
.secondary-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   9. 공통 아이콘 및 이미지
   ============================================ */
.icon-float {
    animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.main-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconFloat 3s ease-in-out infinite;
}

.main-icon .material-symbols-outlined {
    font-size: 40px;
    background: var(--primary-gradient, linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   10. 공통 유틸리티
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* ============================================
   11. 뒤로가기 버튼
   ============================================ */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--border-light, #E5E7EB);
    border-radius: 10px;
    color: var(--text-primary, #1F2937);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    text-decoration: none;
}

.back-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateX(-3px);
}

html.dark .back-btn {
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--text-primary, #F5F5F5);
}

/* ============================================
   12. 헤더 섹션
   ============================================ */
.header {
    text-align: center;
    margin-bottom: 40px;
}