/* static/index.css - Utility / SEO style */
:root {
    --primary-color: #0056b3;
    --primary-hover: #004494;
    --bg-color: #f8f9fa;
    --container-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --ad-bg: #e9ecef;
    --ad-text: #adb5bd;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    word-break: keep-all;
}

.wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    padding: 24px 20px 18px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 50%, #f5f3ff 100%);
    border-radius: 16px;
    border: 1px solid #dbeafe;
    box-shadow: 0 2px 12px rgba(0,86,179,0.06);
}

.site-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.main-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0056b3 0%, #1e40af 50%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.sub-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #6b7280;
    margin: 0;
    padding: 4px 18px;
    background: rgba(255,255,255,0.7);
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    letter-spacing: 1px;
}

header p {
    color: #666;
    margin: 0;
    font-size: 0.95rem;
}

/* ── 네비게이션 메뉴 ── */
.main-nav {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #dbeafe;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.main-nav a {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: #495057;
    background: #fff;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.nav-active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,86,179,0.2);
}
.main-nav a.nav-cta {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    font-weight: 700;
}
.main-nav a.nav-cta:hover {
    background: #ffc107;
    color: #333;
}
@media (max-width: 768px) {
    .main-nav { gap: 4px; }
    .main-nav a { padding: 6px 10px; font-size: 0.78rem; }
}

/* Ad Placement Placeholders */
.ad-slot {
    background-color: var(--ad-bg);
    border: 1px dashed var(--border-color);
    color: var(--ad-text);
    text-align: center;
    padding: 30px 10px;
    margin: 20px 0;
    font-size: 0.9rem;
    font-weight: bold;
}
.ad-top { min-height: 90px; }
.ad-bottom { min-height: 250px; } /* Like a rectangle ad */

.calculator-container {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

select, input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.segment-group {
    display: flex;
    gap: 5px;
}
.segment-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.95rem;
}
.segment-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.preset-btn {
    background: #f1f3f5;
    border: 1px solid #ced4da;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.preset-btn:hover {
    background: #e9ecef;
}
.preset-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.advanced-options {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}
.accordion-content {
    display: none;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
.accordion-item.active .accordion-content {
    display: block;
}

.btn-primary {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}
.btn-primary:hover {
    background: var(--primary-hover);
}
.btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Results Area */
.results-area {
    margin-top: 20px;
}

.result-table-wrapper {
    overflow-x: auto;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: var(--container-bg);
}
.result-table th, .result-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: center;
    font-size: 0.95rem;
}
.result-table th {
    background: #f8f9fa;
    font-weight: bold;
}
.result-table tbody tr {
    cursor: pointer;
    transition: background 0.15s ease;
}
.result-table tbody tr:nth-child(even) {
    background: #fdfdfd;
}
.result-table tbody tr:hover {
    background: #e9ecef;
}

.rank-1 { color: #d97706; font-weight: bold; }
.rank-2 { color: #64748b; font-weight: bold; }
.rank-3 { color: #b45309; font-weight: bold; }

.day-sun { color: red; }
.day-sat { color: blue; }

.seo-content {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 4px;
    margin-top: 30px;
}
.seo-content h2 {
    font-size: 1.3rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    margin-top: 0;
}
.seo-content h3 {
    font-size: 1.1rem;
    margin-top: 20px;
}
.seo-content p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin: 2px;
    white-space: nowrap;
}
.badge-holiday {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.badge-soneopneun {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}
.chart-box {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
}
.chart-box h4 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--primary-color);
}

.intro-content {
    background: #fdfdfd;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 10px 0 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #eaeaea;
}

.intro-section {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.intro-section h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.intro-section p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
    margin: 0;
}

.spinner {
    text-align: center;
    padding: 30px 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.spinner.active {
    display: flex;
}
.spinner-circle {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    font-size: 0.95rem;
    color: #555;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

/* Related Tools Nav */
.related-tools {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.related-tools a {
    text-decoration: none;
    color: var(--primary-color);
    background: #e9ecef;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid #ced4da;
}
.related-tools a:hover {
    background: #dee2e6;
}

/* Slider layout inside accordion */
.slider-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}
.slider-group label {
    font-size: 0.85rem;
    margin-bottom: 3px;
    color: #444;
}
.slider-group input[type="range"] {
    width: 100%;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
}
.modal-close:hover {
    color: #000;
}

/* Mobile Responsive - Full Optimization */
@media (max-width: 768px) {
    /* 기본 레이아웃 */
    .wrapper {
        max-width: 100%;
        padding: 12px;
    }

    /* 타이포그래피 - 가독성 향상 */
    body {
        font-size: 16px;
        line-height: 1.75;
    }
    header {
        padding: 14px 14px 10px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
    .main-title {
        font-size: 1.5rem;
    }
    .sub-title {
        font-size: 0.9rem;
        padding: 3px 14px;
    }
    header p {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* 카드/컨테이너 */
    .calculator-container {
        padding: 14px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }
    .intro-content {
        padding: 10px 12px;
        margin: 8px 0 10px;
    }
    .intro-section {
        padding-bottom: 8px;
        margin-bottom: 8px;
    }
    .intro-section h3 {
        font-size: 1.0rem;
        margin-bottom: 6px;
    }
    .intro-section p {
        font-size: 0.88rem;
        line-height: 1.6;
    }

    /* 폼 요소 */
    .form-group {
        margin-bottom: 12px;
    }
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    .form-row {
        flex-direction: column;
        gap: 8px;
    }
    .form-row .form-group {
        flex: none;
        width: 100%;
    }
    select, input[type="date"] {
        padding: 12px 10px;
        font-size: 16px;  /* iOS zoom 방지 */
        border-radius: 6px;
    }

    /* 버튼 - 터치 최적화 (최소 44px) */
    .btn-primary {
        padding: 16px;
        font-size: 1.05rem;
        border-radius: 8px;
        margin-top: 16px;
        min-height: 48px;
    }
    .btn-primary:disabled {
        font-size: 1.05rem;
    }
    .preset-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        border-radius: 24px;
        min-height: 40px;
    }
    .segment-btn {
        padding: 10px 6px;
        font-size: 0.9rem;
        min-height: 40px;
    }
    .accordion-header {
        font-size: 0.95rem;
        padding: 14px 0;
    }

    /* 결과 테이블 */
    .result-table th, .result-table td {
        padding: 10px 6px;
        font-size: 0.82rem;
        word-break: keep-all;
    }
    .result-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* SEO 콘텐츠 */
    .seo-content {
        padding: 18px 14px;
    }
    .seo-content h2 {
        font-size: 1.15rem;
    }
    .seo-content h3 {
        font-size: 1rem;
        margin-top: 16px;
    }
    .seo-content p {
        font-size: 0.9rem;
        line-height: 1.75;
    }

    /* 모달 */
    .modal-content {
        padding: 20px 16px;
        max-width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }

    /* 프리미엄 카드 */
    .premium-card-header {
        padding: 12px 16px;
    }
    .premium-card-header h3 {
        font-size: 1rem;
    }
    .premium-card-body {
        padding: 14px;
    }
    .expert-metric-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .metric-box {
        padding: 12px;
    }
    .metric-box-title {
        font-size: 0.82rem;
    }
    .metric-box-value {
        font-size: 1.15rem;
    }
    .score-breakdown-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .score-breakdown-item {
        padding: 12px;
    }
    .score-item-label {
        font-size: 0.8rem;
    }
    .score-item-val {
        font-size: 0.9rem;
    }
    .premium-card-footer {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    /* 광고 슬롯 */
    .ad-slot {
        padding: 20px 10px;
        margin: 14px 0;
        font-size: 0.82rem;
    }
    .ad-top { min-height: 60px; }
    .ad-bottom { min-height: 180px; }

    /* 차트 그리드 */
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* 관련 도구 링크 */
    .related-tools a {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

/* 작은 모바일 (iPhone SE 등) */
@media (max-width: 380px) {
    .wrapper {
        padding: 8px;
    }
    header h1 {
        font-size: 1.25rem;
    }
    .main-title {
        font-size: 1.3rem;
    }
    .sub-title {
        font-size: 0.82rem;
        padding: 2px 10px;
    }
    .calculator-container {
        padding: 10px;
    }
    .btn-primary {
        padding: 14px;
        font-size: 1rem;
    }
    .result-table th, .result-table td {
        padding: 8px 4px;
        font-size: 0.75rem;
    }
    .expert-metric-grid {
        grid-template-columns: 1fr;
    }
}

/* Premium Meteorological Analysis Card */
.premium-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-card-header {
    background: linear-gradient(135deg, #0056b3 0%, #002d62 100%);
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.premium-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-card-body {
    padding: 20px;
}

.expert-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.metric-box {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-box-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 5px;
}

.metric-box-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #212529;
}

.metric-gauge-bg {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.metric-gauge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.bg-success-pastel { background-color: #2ecc71; }
.bg-warning-pastel { background-color: #f1c40f; }
.bg-orange-pastel { background-color: #e67e22; }
.bg-danger-pastel { background-color: #e74c3c; }
.bg-info-pastel { background-color: #3498db; }

.score-breakdown-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: #212529;
    margin-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-breakdown-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.score-breakdown-item {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.score-breakdown-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.score-item-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.score-item-val {
    font-size: 0.95rem;
    font-weight: bold;
    color: #212529;
}

.premium-card-footer {
    background: #f8f9fa;
    padding: 12px 20px;
    font-size: 0.85rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}
