/* === 경제 도구 모음 - 세련된 금융 테마 === */

:root {
    /* 메인 컬러 - 네이비 & 골드 */
    --primary: #1a2942;
    --primary-light: #2d4a6f;
    --accent: #c9a227;
    --accent-light: #e8c547;
    
    /* 배경 */
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-card-hover: #1c2333;
    
    /* 텍스트 */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    /* 상태 색상 */
    --success: #3fb950;
    --danger: #f85149;
    --warning: #d29922;
    --info: #58a6ff;
    
    /* 그림자 & 보더 */
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(201, 162, 39, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* 배경 패턴 */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(201, 162, 39, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(26, 41, 66, 0.3) 0%, transparent 50%),
        var(--bg-dark);
}

.blob {
    display: none; /* 기존 blob 숨김 */
}

/* 앱 컨테이너 */
.app-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
}

/* 헤더 */
.app-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.title-with-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(201, 162, 39, 0.3));
    animation: none;
}

.header-controls {
    display: flex;
    gap: 10px;
}

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 버튼 기본 스타일 */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

.icon-btn {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-card);
    color: var(--accent);
}

#back-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
}

#back-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.hidden {
    display: none !important;
}

/* 카카오 배너 */
.kakao-banner {
    width: 100%;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.kakao-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #fee500;
    font-weight: 600;
    font-size: 0.85rem;
}

.kakao-icon {
    width: 18px;
    height: 18px;
    color: #fee500;
}

.kakao-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.kakao-link {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.kakao-link.realestate {
    background: rgba(74, 144, 217, 0.15);
    border-color: rgba(74, 144, 217, 0.3);
    color: #7cb3f0;
}

.kakao-link.hotdeal {
    background: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.3);
    color: #f8847c;
}

.kakao-link:hover {
    transform: translateY(-2px);
}

.kakao-link.realestate:hover {
    background: rgba(74, 144, 217, 0.25);
}

.kakao-link.hotdeal:hover {
    background: rgba(248, 81, 73, 0.25);
}

.kakao-link-icon {
    font-size: 1.5rem;
}

.kakao-link-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kakao-link-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.kakao-link-desc {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 1px;
}

.kakao-link .material-icons-round {
    font-size: 18px;
    opacity: 0.5;
}

/* 메인 메뉴 카드 그리드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    width: 100%;
}

.menu-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.menu-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.menu-card:hover::before {
    transform: scaleX(1);
}

.icon-box {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    border: 1px solid rgba(201, 162, 39, 0.2);
}

.icon-box .material-icons-round {
    font-size: 26px;
    color: var(--accent);
}

.menu-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

/* 도구 컨테이너 */
.tool-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.input-panel,
.result-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.input-panel h3,
.result-panel h3 {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* 입력 그룹 */
.input-group {
    margin-bottom: 16px;
    width: 100%;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* 액션 버튼 */
.action-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent), #b8922a);
    color: #1a1a1a;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
}

.action-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.action-btn.secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.small-btn {
    width: auto;
    padding: 8px 14px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.small-btn .material-icons-round {
    font-size: 16px;
}

/* 결과 박스 */
.result-box {
    margin-top: 10px;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 0.95rem;
    background: var(--bg-dark);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* 요약 카드 */
.summary-card {
    background: linear-gradient(135deg, rgba(26, 41, 66, 0.5), rgba(13, 17, 23, 0.8));
    border: 1px solid var(--border-accent);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 16px;
}

.summary-item {
    text-align: center;
}

.summary-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-item .value.positive {
    color: var(--success);
}

.summary-item .value.negative {
    color: var(--danger);
}

/* 월별 테이블 */
.monthly-table-container {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-dark);
    border-radius: 10px;
    margin-top: 10px;
    border: 1px solid var(--border);
}

.monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.monthly-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.monthly-table th,
.monthly-table td {
    padding: 10px 6px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}

.monthly-table th:first-child,
.monthly-table td:first-child {
    text-align: center;
    width: 40px;
}

.monthly-table th:not(:first-child),
.monthly-table td:not(:first-child) {
    width: calc((100% - 40px) / 4);
}

.monthly-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.monthly-table tbody tr:hover {
    background: var(--bg-card);
}

.monthly-table tfoot {
    background: rgba(201, 162, 39, 0.1);
    font-weight: 600;
}

.monthly-table tfoot td {
    border-top: 2px solid var(--border-accent);
    color: var(--accent);
    font-size: 0.75rem;
}

/* 탭 스위치 */
.tab-switch {
    display: flex;
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
}

.tab-switch button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tab-switch button.active {
    background: var(--accent);
    color: #1a1a1a;
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    padding: 28px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    z-index: 2001;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.modal-actions .action-btn {
    flex: 1;
}

/* 워터마크 */
.watermark {
    position: fixed;
    bottom: 20px;
    right: 20px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.watermark img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* 반응형 */
@media (max-width: 600px) {
    .app-container {
        padding: 16px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .header-logo {
        width: 36px;
        height: 36px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-card {
        padding: 20px;
    }
    
    .tool-container {
        flex-direction: column;
    }
    
    .input-panel,
    .result-panel {
        min-width: 100%;
    }
    
    .monthly-table {
        font-size: 0.7rem;
    }
    
    .summary-card {
        grid-template-columns: 1fr 1fr;
    }
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ==================== 정책 페이지 스타일 ==================== */

/* 정책 소개 */
.policy-intro {
    background: linear-gradient(135deg, rgba(26, 41, 66, 0.6), rgba(13, 17, 23, 0.9));
    border: 1px solid var(--border-accent);
    border-radius: 14px;
    padding: 28px;
    margin-bottom: 28px;
    text-align: center;
}

.policy-intro h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 12px;
    font-weight: 600;
}

.policy-intro p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

/* 정책 그리드 */
.policy-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
    .policy-grid {
        grid-template-columns: 1fr;
    }
}

/* 정책 카드 */
.policy-card {
    position: relative;
}

.policy-card .policy-period {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.policy-card .policy-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.policy-card.moon .policy-tag {
    background: rgba(248, 81, 73, 0.2);
    color: #f8847c;
}

.policy-card.yoon .policy-tag {
    background: rgba(63, 185, 80, 0.2);
    color: #7ee787;
}

.policy-card.lee .policy-tag {
    background: rgba(88, 166, 255, 0.2);
    color: #79c0ff;
}

.policy-card.moon .icon-box {
    background: linear-gradient(135deg, #4a2c2a, #6b3a38);
}

.policy-card.yoon .icon-box {
    background: linear-gradient(135deg, #2a4a3a, #3a6b4a);
}

.policy-card.lee .icon-box {
    background: linear-gradient(135deg, #2a3a4a, #3a4a6b);
}

/* 정책 상세 페이지 */
.policy-page {
    max-width: 1100px;
}

.policy-header {
    border-radius: 14px;
    padding: 32px;
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.policy-header.moon {
    background: linear-gradient(135deg, rgba(248, 81, 73, 0.1), rgba(13, 17, 23, 0.95));
    border-color: rgba(248, 81, 73, 0.3);
}

.policy-header.yoon {
    background: linear-gradient(135deg, rgba(63, 185, 80, 0.1), rgba(13, 17, 23, 0.95));
    border-color: rgba(63, 185, 80, 0.3);
}

.policy-header.lee {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), rgba(13, 17, 23, 0.95));
    border-color: rgba(88, 166, 255, 0.3);
}

.policy-header-content {
    max-width: 800px;
}

.policy-period-badge {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-dark);
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
}

.policy-header h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.policy-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* 정책 섹션 */
.policy-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
}

.policy-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.policy-section h3 .material-icons-round {
    font-size: 20px;
}

/* 정책 테이블 */
.policy-table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.policy-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 700px;
}

.policy-table th,
.policy-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.policy-table th {
    background: var(--bg-dark);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.policy-table td {
    color: var(--text-secondary);
}

.policy-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.policy-table td:nth-child(2) {
    color: var(--accent);
    font-weight: 500;
}

.policy-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.policy-table .phase-header {
    background: rgba(201, 162, 39, 0.08);
}

.policy-table .phase-header td {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.85rem;
    padding: 10px 14px;
}

/* 분석 카드 */
.analysis-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.analysis-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.analysis-phase {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
    display: inline-block;
    background: rgba(201, 162, 39, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
}

.analysis-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* 정책 네비게이션 */
.policy-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
}

.policy-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.policy-nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

.policy-nav-btn.next {
    margin-left: auto;
}

.policy-nav-btn .material-icons-round {
    font-size: 18px;
}

@media (max-width: 600px) {
    .policy-header {
        padding: 20px;
    }
    
    .policy-header h2 {
        font-size: 1.15rem;
    }
    
    .policy-section {
        padding: 16px;
    }
    
    .policy-table {
        font-size: 0.7rem;
    }
    
    .policy-nav {
        flex-direction: column;
    }
    
    .policy-nav-btn.next {
        margin-left: 0;
    }
}
