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

/* 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 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e40af;
}
.logo:hover { text-decoration: none; }
.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; }

/* Responsive */
@media (max-width: 768px) {
    .header-inner { height: auto; padding: 10px 0; flex-direction: column; gap: 8px; }
    .main-nav { gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: 0.85rem; }
    .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;
}

/* 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;
}
