/* 위비파이 청약정보 - 스타일시트 */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans KR", "Segoe UI", sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.logo {
    display: flex;
    align-items: center;
}
.logo:hover { text-decoration: none; }
.header-logo { display: block; height: 32px; width: auto; }
.site-title {
    font-size: 1.05rem; font-weight: 700; color: #1e293b;
    margin-left: 10px; padding-left: 10px;
    border-left: 2px solid #e2e8f0;
    line-height: 1.2;
}
.main-nav { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
}
.nav-link:hover { background: #f1f5f9; color: #1e40af; text-decoration: none; }
.nav-link.active { background: #eff6ff; color: #1e40af; font-weight: 600; }

/* Filter Bar */
.filter-bar {
    background: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.filter-bar select, .filter-bar input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
}
.filter-bar select:focus, .filter-bar input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.filter-bar input[type="text"] { flex: 1; min-width: 150px; }
.btn-search {
    padding: 8px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
}
.btn-search:hover { background: #1d4ed8; }

/* Table */
.table-wrap {
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table thead { background: #f8fafc; }
.data-table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    font-size: 0.85rem;
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .col-region { width: 70px; text-align: center; }
.data-table .col-name { min-width: 200px; }
.data-table .col-name a { color: #1e293b; font-weight: 500; }
.data-table .col-name a:hover { color: #2563eb; }
.data-table .col-supply { text-align: right; width: 70px; }
.data-table .col-date { width: 80px; text-align: center; white-space: nowrap; }
.data-table .col-period { width: 120px; text-align: center; white-space: nowrap; }
.data-table .col-status { width: 80px; text-align: center; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-upcoming { background: #fef3c7; color: #92400e; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-closed { background: #f1f5f9; color: #64748b; }
.badge-done { background: #dbeafe; color: #1e40af; }
.badge-type { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }

/* Regulation Tags */
.regulation-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.reg-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.tag-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.tag-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.tag-info { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.tag-default { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #475569;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.pagination a:hover { background: #f1f5f9; text-decoration: none; }
.pagination .current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    font-weight: 600;
}
.pagination .disabled { color: #cbd5e1; pointer-events: none; }

/* Detail Page */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.detail-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}
.detail-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}
.info-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.info-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}
.info-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0;
}
.info-grid dt {
    padding: 10px 0;
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}
.info-grid dd {
    padding: 10px 0;
    color: #1e293b;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}
.info-grid dd .zip {
    color: #94a3b8;
    font-size: 0.85rem;
}
.info-grid dd a {
    word-break: break-all;
}

/* Schedule Table */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
}
.schedule-table th {
    background: #f8fafc;
    padding: 10px 14px;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    text-align: center;
    width: 140px;
}
.schedule-table td {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
.schedule-table td.label {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    width: 140px;
    text-align: center;
}

/* Unit Types Table */
.unit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.unit-table thead { background: #f8fafc; }
.unit-table th {
    padding: 10px 8px;
    font-weight: 600;
    color: #475569;
    border: 1px solid #e2e8f0;
    text-align: center;
    white-space: nowrap;
}
.unit-table td {
    padding: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}
.unit-table td.price { text-align: right; font-weight: 600; color: #1e40af; }

/* ApplyHome Link */
.btn-applyhome {
    display: inline-block;
    padding: 10px 24px;
    background: #2563eb;
    color: #fff !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.btn-applyhome:hover { background: #1d4ed8; text-decoration: none; }

/* Back Link */
.back-link {
    display: inline-block;
    margin: 20px 0;
    padding: 10px 20px;
    background: #f1f5f9;
    border-radius: 6px;
    color: #475569;
    font-size: 0.9rem;
}
.back-link:hover { background: #e2e8f0; text-decoration: none; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 1rem;
}

/* Footer */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 0.85rem;
    line-height: 1.8;
    text-align: center;
}
.site-footer a { color: #93c5fd; }
.footer-logo { margin-bottom: 12px; }
.footer-logo img { display: inline-block; height: 28px; width: auto; opacity: 0.9; }

/* Responsive */
@media (max-width: 768px) {
    .header-inner { height: auto; padding: 8px 0; flex-wrap: wrap; gap: 4px; }
    .main-nav { gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: 0.85rem; }
    .site-title { font-size: 0.85rem; margin-left: 8px; padding-left: 8px; }
    .filter-bar { flex-direction: column; }
    .filter-bar select, .filter-bar input[type="text"] { width: 100%; }
    .info-grid { grid-template-columns: 100px 1fr; }
    .info-grid dt, .info-grid dd { padding: 8px 0; font-size: 0.85rem; }
    .detail-header h1 { font-size: 1.2rem; }
    .detail-header { flex-direction: column; align-items: flex-start; }
    .schedule-table td.label { width: 110px; font-size: 0.8rem; }
}

/* No data */
.no-data td {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

/* Nearby Listings */
.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nearby-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 6px;
    color: #1e293b;
    transition: background 0.2s;
    flex-wrap: wrap;
}
.nearby-item:hover {
    background: #eff6ff;
    text-decoration: none;
}
.nearby-name {
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
    min-width: 150px;
}
.nearby-meta {
    font-size: 0.82rem;
    color: #64748b;
}

/* SNS 공유 */
.share-bar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.share-label { font-size: 0.9rem; color: #64748b; font-weight: 600; white-space: nowrap; }
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform .15s, box-shadow .15s; font-size: 17px; color: #fff;
}
.share-btn:hover { transform: scale(1.1); box-shadow: 0 3px 10px rgba(0,0,0,0.2); }
.share-kakao { background: #FEE500; color: #3C1E1E; }
.share-facebook { background: #1877F2; }
.share-x { background: #000; }
.share-naver { background: #03C75A; }
.share-copy { background: #6b7280; }
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: #333; color: #fff; padding: 10px 24px; border-radius: 8px;
    font-size: 0.9rem; z-index: 999; display: none;
}

/* Map container & overlay */
.map-container { position: relative; }
.map-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 450;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 6px;
}
.map-overlay span {
    background: rgba(0,0,0,0.55); color: #fff; padding: 8px 18px;
    border-radius: 20px; font-size: 0.85rem; font-weight: 500;
    pointer-events: none;
}
.map-legend {
    display: flex; gap: 16px; flex-wrap: wrap;
    padding: 8px 0 0; font-size: 0.82rem; color: #64748b;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
    border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.legend-red { background: #dc2626; }
.legend-blue { background: #3b82f6; }
.legend-green { background: #22c55e; }

/* 대출 추천 배너 */
.loan-recommend-banner {
    margin: 16px 0;
    padding: 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border: 1px solid #fed7aa;
}
.loan-recommend-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.loan-recommend-icon { font-size: 18px; }
.loan-recommend-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.loan-recommend-cards {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.loan-card {
    flex: 1;
    min-width: 0;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: box-shadow 0.2s, border-color 0.2s;
    color: #1e293b;
}
.loan-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #f97316;
    text-decoration: none;
}
.loan-bank {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.loan-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}
.loan-rate {
    font-size: 15px;
    font-weight: 700;
    color: #ea580c;
}
.loan-recommend-more {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #ea580c;
}
.loan-recommend-more:hover { text-decoration: underline; }

@media (max-width: 480px) {
    .loan-recommend-cards { flex-direction: column; }
    .loan-card { flex: none; }
}

/* Leaflet overrides */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    font-family: inherit;
}
.leaflet-popup-content {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 10px 14px;
}
