/* ============================================
   아이맘머니 - 출산지원금 가이드
   style.css - 데스크톱 스타일
   ============================================ */

/* 폰트 임포트 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

/* CSS 변수 */
:root {
    --primary: #FF6B9D;
    --primary-dark: #E54D7A;
    --primary-light: #FFB3CC;
    --secondary: #6C63FF;
    --accent: #FFD93D;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --text-dark: #2D3436;
    --text-gray: #636E72;
    --text-light: #B2BEC3;
    --bg-main: #FFF9FB;
    --bg-card: #FFFFFF;
    --bg-section: #FFF0F5;
    --border-color: #FFE4EC;
    --shadow-sm: 0 2px 8px rgba(255, 107, 157, 0.1);
    --shadow-md: 0 4px 20px rgba(255, 107, 157, 0.15);
    --shadow-lg: 0 8px 40px rgba(255, 107, 157, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-main);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* 레이아웃 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-wrapper {
    display: flex;
    gap: 30px;
    padding: 30px 0;
}

.content-area {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* 헤더 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

.logo-icon {
    font-size: 32px;
}

.header-nav {
    display: flex;
    gap: 30px;
}

.header-nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: var(--transition);
}

.header-nav a:hover {
    color: white;
}

/* 히어로 섹션 */
.hero {
    background: linear-gradient(135deg, var(--bg-section) 0%, var(--bg-main) 100%);
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    font-size: 18px;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* 검색 섹션 */
.search-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.search-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-dark);
    background: white;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23636E72' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

.form-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

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

/* 결과 섹션 */
.results-section {
    margin-top: 40px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.results-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
}

.results-count {
    font-size: 14px;
    color: var(--text-gray);
    background: var(--bg-section);
    padding: 8px 16px;
    border-radius: 20px;
}

.results-count strong {
    color: var(--primary);
}

/* 카드 그리드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

/* 지원금 카드 */
.support-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.support-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-region {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-section);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
    line-height: 1.4;
}

.card-amounts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.amount-item {
    background: var(--bg-section);
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.amount-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 4px;
}

.amount-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-dark);
}

.amount-value.empty {
    color: var(--text-light);
}

.card-info {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-icon {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.info-label {
    color: var(--text-gray);
    flex-shrink: 0;
    width: 70px;
}

.info-value {
    color: var(--text-dark);
    flex: 1;
}

/* 광고 영역 */
.ad-container {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
}

.ad-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.ad-placeholder {
    background: var(--bg-section);
    border-radius: var(--radius-sm);
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
}

.ad-horizontal {
    margin: 30px 0;
}

/* 사이드바 광고 */
.sidebar .ad-container {
    position: sticky;
    top: 100px;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-gray);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.empty-desc {
    font-size: 15px;
}

/* 로딩 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    color: var(--text-gray);
    font-size: 15px;
}

/* 푸터 */
.footer {
    background: var(--text-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-info {
    font-size: 14px;
    line-height: 1.8;
}

.footer-copyright {
    font-size: 13px;
    opacity: 0.7;
}

/* 알림 토스트 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-dark);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.toast.show {
    display: block;
}

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

/* 스크롤바 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-section);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 애니메이션 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease;
}

/* 준비중 뱃지 */
.badge-preparing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--text-light);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}
/* ============================================
   모달 스타일
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-section);
    color: var(--text-gray);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    z-index: 10;
}

.modal-close:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-region {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-section);
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.4;
    padding-right: 30px;
}

.modal-body {
    padding: 24px 30px 30px;
}

.modal-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.modal-amount-item {
    background: linear-gradient(135deg, var(--bg-section) 0%, #fff 100%);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.modal-amount-label {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 6px;
}

.modal-amount-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-dark);
    word-break: keep-all;
}

.modal-amount-value.empty {
    color: var(--text-light);
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-info-item {
    background: var(--bg-section);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.modal-info-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-info-value {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: keep-all;
}

/* 카드 클릭 커서 */
.support-card {
    cursor: pointer;
}

.support-card:active {
    transform: scale(0.98);
}