/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  color: #1f2937;
  background: #f7fafc;
}

/* ── Navigation ── */
.site-nav {
  background: #0f172a;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: 48px;
}

.site-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a.nav-active {
  background: #1e293b;
  color: #f1f5f9;
}

.map-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
}

.panel h1,
.panel h2 {
  margin: 0 0 0.5rem;
  color: #0f172a;
}

.desc {
  margin: 0;
  color: #334155;
}

.controls {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: center;
}

.controls input,
.controls button {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 0.75rem;
  font-size: 14px;
}

.controls button {
  cursor: pointer;
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.controls button:hover {
  background: #115e59;
}

.print-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #0f766e;
  color: #0f766e;
  text-decoration: none;
  padding: 0 0.75rem;
  font-size: 14px;
  background: #ffffff;
}

.print-button {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #334155;
  color: #ffffff;
  padding: 0 0.75rem;
  cursor: pointer;
}

.status {
  margin: 0.75rem 0 0;
  font-size: 14px;
  color: #475569;
}

.map {
  height: 60vh;
  min-height: 420px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  overflow: hidden;
}

.clinic-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.clinic-list li {
  margin: 0.25rem 0;
}

.clinic-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 14px;
}

.clinic-table th,
.clinic-table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  text-align: left;
}

.clinic-table th {
  background: #f8fafc;
}

.table-badge {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: #0f766e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.badge-marker-wrapper {
  background: transparent;
  border: none;
}

.badge-marker {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.35);
}

.badge-marker--clinic {
  background: #0f766e;
}

.badge-marker--origin {
  background: #dc2626;
}

/* ── Flash messages ── */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 14px;
  margin: 0;
}

.flash-notice {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.flash-alert {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Keyword checker ── */
.keyword-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.form-row input {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 0.75rem;
  font-size: 14px;
  min-width: 200px;
}

.form-row .input-short {
  min-width: 60px;
  max-width: 80px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 14px;
  height: 36px;
}

.form-actions {
  margin-top: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 0.75rem;
  font-size: 14px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: #f1f5f9;
}

.btn-primary {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.btn-primary:hover {
  background: #115e59;
}

.btn-danger {
  background: #ffffff;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-link {
  background: transparent;
  border-color: #0f766e;
  color: #0f766e;
}

.btn-sm {
  height: 30px;
  font-size: 13px;
  padding: 0 0.5rem;
}

.action-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

.keyword-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.keyword-table th,
.keyword-table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  text-align: left;
  vertical-align: middle;
}

.keyword-table th {
  background: #f8fafc;
  font-weight: 600;
}

.kw-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.kw-status--on {
  background: #ecfdf5;
  color: #065f46;
}

.kw-status--off {
  background: #f1f5f9;
  color: #64748b;
}

.text-danger {
  color: #dc2626;
  font-weight: 600;
}

.channel-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.channel-badge {
  font-size: 12px;
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .controls {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .no-print,
  .leaflet-control-container {
    display: none !important;
  }

  .map-page {
    max-width: none;
    padding: 0;
    gap: 0.6rem;
  }

  .panel {
    border: 1px solid #cbd5e1;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .map {
    height: 120mm;
    min-height: 120mm;
    border: 1px solid #94a3b8;
    break-inside: avoid;
  }

  .clinic-table th,
  .clinic-table td {
    font-size: 12px;
  }
}
