@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Noto Sans KR', Arial, sans-serif;
    background: #f0f4ff;
    color: #1a1a2e;
    line-height: 1.6;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0;
}

/* ── Map Page ── */
.map-page {
    display: flex;
    height: calc(100vh - 60px);
    min-height: 500px;
}

#map {
    flex: 1;
    min-height: 0;
}

.map-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    overflow: hidden;
    min-height: 0;
}

.map-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.map-sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

#map-pool-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 8px 0;
}

.map-pool-item {
    border-bottom: 1px solid #f0f0f0;
}

.map-pool-item a {
    display: flex;
    flex-direction: column;
    padding: 12px 20px;
    text-decoration: none;
    color: inherit;
    gap: 3px;
    transition: background 0.15s;
}

.map-pool-item a:hover {
    background: #f0f4ff;
}

.map-pool-item strong {
    font-size: 0.92rem;
    color: #1a1a2e;
    cursor: pointer;
}

.map-pool-item span {
    font-size: 0.8rem;
    color: #888;
}

.map-infowin {
    padding: 10px 14px;
    min-width: 180px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.85rem;
    line-height: 1.6;
}

.map-infowin strong a {
    color: #1565c0;
    text-decoration: none;
    font-size: 0.95rem;
}

.map-infowin p {
    color: #666;
    margin-top: 2px;
}

@media (max-width: 680px) {
    .map-page {
        flex-direction: column;
        height: calc(100vh - 60px);
        min-height: 500px;
    }
    #map {
        flex: 0 0 55%;
        min-height: 250px;
    }
    .map-sidebar {
        flex: 1;
        width: 100%;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
}

/* ── Header ── */
.site-header {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    padding: 0;
    box-shadow: 0 2px 12px rgba(13,71,161,.3);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.site-header .logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}
.site-header nav { display: flex; align-items: center; gap: 6px; }
.site-header nav a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background .2s, color .2s;
}
.site-header nav a:hover { background: rgba(255,255,255,.15); color: #fff; }
.site-header nav a.nav-logout {
    background: rgba(255,255,255,.1);
    color: #ffcdd2;
}
.site-header nav a.nav-logout:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── Hero ── */
.hero {
    background: linear-gradient(160deg, #1565c0 0%, #1976d2 50%, #42a5f5 100%);
    color: #fff;
    padding: 56px 0 48px;
    text-align: center;
}
.hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 10px;
}
.hero .lead {
    font-size: 1rem;
    color: rgba(255,255,255,.85);
    margin-bottom: 0;
}

/* ── Search Form ── */
.search-wrap {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 8px 40px rgba(13,71,161,.15);
    margin: -28px auto 0;
    max-width: 860px;
    position: relative;
    z-index: 10;
}
.search-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.form-row input,
.form-row select {
    padding: 11px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
    width: 100%;
}
.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,.12);
    background: #fff;
}
.btn-search {
    padding: 11px 24px;
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    white-space: nowrap;
}
.btn-search:hover  { opacity: .9; }
.btn-search:active { transform: scale(.98); }

/* ── Main ── */
main.container { padding-top: 40px; padding-bottom: 72px; }

/* ── Results ── */
.results-section { margin-top: 36px; }
.results-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.results-header h2 { font-size: 1.15rem; font-weight: 700; }
.results-count {
    background: #1565c0;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.pool-list { list-style: none; display: grid; gap: 12px; }

.pool-card a {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-left: 4px solid #1565c0;
    transition: box-shadow .2s, transform .15s;
}
.pool-card a:hover {
    box-shadow: 0 6px 24px rgba(21,101,192,.15);
    transform: translateY(-2px);
}
.pool-card-info { flex: 1; min-width: 0; }
.pool-card strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pool-card .pool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 0.82rem;
    color: #777;
}
.pool-card .pool-region::before  { content: '📍 '; }
.pool-card .pool-address::before { content: '🏠 '; }
.pool-dist {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.78rem;
}

.pool-card .pool-time {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #0d47a1;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.9rem;
    text-align: center;
    flex-shrink: 0;
}
.pool-card .pool-time small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #1565c0;
    margin-bottom: 2px;
}

/* 로딩 스피너 */
.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    padding: 32px 0;
}
.spinner {
    width: 20px; height: 20px;
    border: 2px solid #ddd;
    border-top-color: #1565c0;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.no-result {
    text-align: center;
    color: #999;
    padding: 48px 0;
    font-size: 1rem;
}
.no-result::before { content: '🏊'; display: block; font-size: 2.5rem; margin-bottom: 12px; }

.error-msg { color: #c62828; padding: 20px 0; }

/* ── Detail ── */
.detail-back {
    margin-bottom: 20px;
}
.detail-back a {
    color: #1565c0;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.detail-back a:hover { text-decoration: underline; }

.detail-wrap { max-width: 760px; margin: 0 auto; }

.detail-hero {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    margin-bottom: 20px;
}
.detail-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.status-on  { background: rgba(255,255,255,.2); color: #fff; }
.status-off { background: rgba(255,0,0,.25);    color: #ffcdd2; }

.detail-hero h1 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}
.detail-region { color: rgba(255,255,255,.75); font-size: 0.9rem; }

.detail-body { display: flex; flex-direction: column; gap: 16px; }

.detail-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px 26px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.detail-card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1565c0;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3f2fd;
}

.detail-info { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.detail-info li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; }
.info-icon { font-size: 1.1rem; flex-shrink: 0; }
.detail-info a { color: #1565c0; text-decoration: none; }
.detail-info a:hover { text-decoration: underline; }

/* 시간표 테이블 */
.sched-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.82rem;
}
.sched-table th {
    padding: 10px 4px;
    font-weight: 700;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}
.sched-table th.today { color: #1565c0; }
.sched-table th.sun   { color: #e53935; }
.sched-table th.sat   { color: #1565c0; }
.today-dot {
    display: block;
    width: 5px; height: 5px;
    background: #1565c0;
    border-radius: 50%;
    margin: 3px auto 0;
}
.sched-table td {
    padding: 12px 4px;
    vertical-align: top;
    border-right: 1px solid #f0f0f0;
}
.sched-table td:last-child { border-right: none; }
.sched-table td.today { background: #f0f7ff; }

.sched-slot {
    background: #e3f2fd;
    color: #0d47a1;
    border-radius: 8px;
    padding: 6px 4px;
    margin-bottom: 6px;
    font-weight: 700;
    line-height: 1.4;
}
.sched-slot span { font-size: 0.7rem; color: #1976d2; font-weight: 400; }
.sched-none { color: #ccc; font-size: 0.8rem; }

@media (max-width: 560px) {
    .detail-hero { padding: 24px 20px; }
    .detail-card { padding: 20px 16px; }
    .sched-table { font-size: 0.72rem; }
    .sched-table th, .sched-table td { padding: 8px 2px; }
}

/* ── Admin ── */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8eaf6;
}
.admin-header h1 { font-size: 1.4rem; font-weight: 700; }
.admin-header a { color: #1565c0; text-decoration: none; font-size: 0.9rem; }

.btn-add {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #fff;
    padding: 9px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: opacity .2s;
}
.btn-add:hover { opacity: .88; color: #fff; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
.admin-table th {
    background: #e8eaf6;
    padding: 13px 16px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 700;
    color: #3949ab;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.admin-table td {
    padding: 13px 16px;
    border-top: 1px solid #f4f4f8;
    font-size: 0.9rem;
    vertical-align: middle;
}
.admin-table tbody tr:hover td { background: #f8f9ff; }

.actions { display: flex; gap: 8px; }
.actions a {
    font-size: 0.82rem;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    transition: background .15s;
}
.actions a:not(.btn-del) { color: #1565c0; background: #e3f2fd; }
.actions a:not(.btn-del):hover { background: #bbdefb; }
.btn-del { color: #c62828 !important; background: #fce4ec !important; }
.btn-del:hover { background: #f8bbd0 !important; }

.badge-on  { background: #e8f5e9; color: #2e7d32; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; }
.badge-off { background: #fce4ec; color: #c62828; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; }

.admin-form {
    background: #fff;
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.admin-form-inline {
    flex-direction: row;
    flex-wrap: wrap;
    max-width: 100%;
    align-items: flex-end;
    gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 700; color: #555; }
.form-group textarea {
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 9px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color .2s;
    background: #fafafa;
    resize: vertical;
}
.form-group textarea:focus {
    outline: none;
    border-color: #1565c0;
    background: #fff;
}
.address-wrap {
    display: flex;
    gap: 8px;
}
.address-wrap input {
    flex: 1;
}
.btn-addr-search {
    padding: 10px 16px;
    background: #455a64;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s;
}
.btn-addr-search:hover { opacity: .85; }
.detail-description {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.8;
    margin-top: 12px;
}

.form-group input[type=text],
.form-group input[type=password],
.form-group select {
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 9px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color .2s;
    background: #fafafa;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1565c0;
    background: #fff;
}
.form-check { flex-direction: row; align-items: center; }
.btn-save {
    padding: 11px 32px;
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .2s;
    align-self: flex-start;
}
.btn-save:hover { opacity: .88; }

.msg-success {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px 18px;
    border-radius: 10px;
    border-left: 4px solid #43a047;
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.msg-error {
    background: #fce4ec;
    color: #c62828;
    padding: 12px 18px;
    border-radius: 10px;
    border-left: 4px solid #e53935;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

/* ── Footer ── */
.site-footer {
    background: #0d1b4b;
    color: #7986cb;
    text-align: center;
    padding: 24px 20px;
    font-size: 0.82rem;
    margin-top: auto;
}

/* ── SEO Info Section ── */
.seo-info {
    margin: 48px 0 24px;
    padding: 28px 32px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #555;
}
.seo-info h2 {
    font-size: 1rem;
    color: #888;
    margin-bottom: 10px;
    font-weight: 600;
}
.seo-info p {
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 12px;
}
.seo-info ul {
    font-size: 0.88rem;
    padding-left: 20px;
    line-height: 2;
    color: #777;
}

/* ── Mobile ── */
@media (max-width: 680px) {
    .hero { padding: 40px 0 44px; }
    .search-wrap { margin: -24px 12px 0; padding: 20px 16px; }
    .search-form { grid-template-columns: 1fr 1fr; }
    .form-row-keyword { grid-column: 1 / -1; }
    .btn-search { grid-column: 1 / -1; }

    .pool-card a { flex-direction: column; align-items: flex-start; gap: 10px; }
    .pool-card .pool-time { align-self: flex-start; }

    .admin-table { font-size: 0.82rem; }
    .admin-table th, .admin-table td { padding: 10px 10px; }

    .site-header nav a { padding: 5px 8px; font-size: 0.82rem; }
}

@media (max-width: 420px) {
    .search-form { grid-template-columns: 1fr; }
}
