/* ═══════════════════════════════════════════════
   人流管理平台 — Swagger UI 自訂主題
   Dark mode, modern aesthetic
   ═══════════════════════════════════════════════ */

/* ── 全域 ── */
html { scroll-behavior: smooth; }

body {
  background: #0f172a !important;
  color: #e2e8f0 !important;
}

.swagger-ui {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  color: #e2e8f0 !important;
}

/* ── Top Bar ── */
.swagger-ui .topbar {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-bottom: 1px solid #334155 !important;
  padding: 12px 0 !important;
}

.swagger-ui .topbar .download-url-wrapper .select-label span {
  color: #94a3b8 !important;
}

.swagger-ui .topbar a { display: none; } /* Hide default Swagger logo */

.swagger-ui .topbar::before {
  content: '🏛️ 麥寮社教園區 — 人流管理平台 API';
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  display: block;
  text-align: center;
  padding: 4px 0;
  letter-spacing: 0.5px;
}

.swagger-ui .topbar .download-url-wrapper input {
  background: #1e293b !important;
  border: 1px solid #475569 !important;
  color: #e2e8f0 !important;
  border-radius: 6px !important;
}

/* ── Info Section ── */
.swagger-ui .info {
  margin: 30px 0 20px !important;
}

.swagger-ui .info .title {
  color: #f1f5f9 !important;
  font-size: 28px !important;
  font-weight: 800 !important;
}

.swagger-ui .info .title small {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
  color: #fff !important;
  border-radius: 20px !important;
  padding: 2px 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  vertical-align: middle !important;
  margin-left: 8px !important;
}

.swagger-ui .info .title small pre {
  color: #fff !important;
}

.swagger-ui .info .description,
.swagger-ui .info .description p,
.swagger-ui .info .description li {
  color: #94a3b8 !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}

.swagger-ui .info .description h2 {
  color: #e2e8f0 !important;
  border-bottom: 1px solid #334155 !important;
  padding-bottom: 8px !important;
  margin-top: 20px !important;
}

.swagger-ui .info .description code {
  background: #1e293b !important;
  color: #38bdf8 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-size: 13px !important;
}

.swagger-ui .info .description strong {
  color: #f1f5f9 !important;
}

/* ── Scheme Container ── */
.swagger-ui .scheme-container {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 8px !important;
  padding: 12px 20px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

/* ── Authorize Button ── */
.swagger-ui .btn.authorize {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 20px !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3) !important;
}
.swagger-ui .btn.authorize:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4) !important;
}
.swagger-ui .btn.authorize svg { fill: #fff !important; }

/* ── Tag Groups ── */
.swagger-ui .opblock-tag-section {
  margin-bottom: 8px !important;
}

.swagger-ui .opblock-tag {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 10px !important;
  padding: 12px 20px !important;
  margin: 0 !important;
  transition: all 0.2s !important;
}
.swagger-ui .opblock-tag:hover {
  background: #263548 !important;
  border-color: #3b82f6 !important;
}
.swagger-ui .opblock-tag a { color: #f1f5f9 !important; font-weight: 600 !important; }
.swagger-ui .opblock-tag small { color: #64748b !important; }
.swagger-ui .opblock-tag svg { fill: #64748b !important; }

/* ── Operation Blocks ── */
.swagger-ui .opblock {
  border-radius: 10px !important;
  margin: 6px 0 !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2) !important;
  overflow: hidden !important;
}

.swagger-ui .opblock .opblock-summary {
  border: none !important;
  padding: 10px 16px !important;
}

.swagger-ui .opblock .opblock-summary-method {
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  min-width: 70px !important;
  text-align: center !important;
  padding: 6px 12px !important;
}

/* Method colors */
.swagger-ui .opblock.opblock-get {
  background: rgba(34, 197, 94, 0.08) !important;
  border-color: rgba(34, 197, 94, 0.25) !important;
}
.swagger-ui .opblock.opblock-get .opblock-summary-method {
  background: #22c55e !important;
}
.swagger-ui .opblock.opblock-get .opblock-summary { border-color: transparent !important; }

.swagger-ui .opblock.opblock-post {
  background: rgba(59, 130, 246, 0.08) !important;
  border-color: rgba(59, 130, 246, 0.25) !important;
}
.swagger-ui .opblock.opblock-post .opblock-summary-method {
  background: #3b82f6 !important;
}
.swagger-ui .opblock.opblock-post .opblock-summary { border-color: transparent !important; }

.swagger-ui .opblock.opblock-put {
  background: rgba(245, 158, 11, 0.08) !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
}
.swagger-ui .opblock.opblock-put .opblock-summary-method {
  background: #f59e0b !important;
}
.swagger-ui .opblock.opblock-put .opblock-summary { border-color: transparent !important; }

.swagger-ui .opblock.opblock-delete {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}
.swagger-ui .opblock.opblock-delete .opblock-summary-method {
  background: #ef4444 !important;
}
.swagger-ui .opblock.opblock-delete .opblock-summary { border-color: transparent !important; }

.swagger-ui .opblock.opblock-patch {
  background: rgba(168, 85, 247, 0.08) !important;
  border-color: rgba(168, 85, 247, 0.25) !important;
}
.swagger-ui .opblock.opblock-patch .opblock-summary-method {
  background: #a855f7 !important;
}
.swagger-ui .opblock.opblock-patch .opblock-summary { border-color: transparent !important; }

/* Summary path + description */
.swagger-ui .opblock .opblock-summary-path { color: #e2e8f0 !important; }
.swagger-ui .opblock .opblock-summary-path__deprecated { color: #64748b !important; }
.swagger-ui .opblock .opblock-summary-description { color: #94a3b8 !important; }

/* Expanded body */
.swagger-ui .opblock-body {
  background: #0f172a !important;
  border-top: 1px solid #1e293b !important;
}
.swagger-ui .opblock-body pre {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-radius: 8px !important;
  border: 1px solid #334155 !important;
}

/* ── Parameters ── */
.swagger-ui .parameters-col_description p,
.swagger-ui .parameters-col_description input,
.swagger-ui .parameter__name {
  color: #cbd5e1 !important;
}
.swagger-ui .parameter__name.required::after {
  color: #ef4444 !important;
}
.swagger-ui .parameter__type {
  color: #38bdf8 !important;
  font-size: 12px !important;
}

.swagger-ui table thead tr th,
.swagger-ui table thead tr td {
  color: #94a3b8 !important;
  border-bottom: 1px solid #334155 !important;
}
.swagger-ui table tbody tr td {
  color: #e2e8f0 !important;
  border-bottom: 1px solid #1e293b !important;
}

/* ── Inputs ── */
.swagger-ui input[type=text],
.swagger-ui input[type=password],
.swagger-ui input[type=search],
.swagger-ui input[type=email],
.swagger-ui input[type=file],
.swagger-ui textarea,
.swagger-ui select {
  background: #1e293b !important;
  border: 1px solid #475569 !important;
  color: #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
}
.swagger-ui input:focus,
.swagger-ui textarea:focus,
.swagger-ui select:focus {
  border-color: #3b82f6 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important;
}

/* ── Buttons ── */
.swagger-ui .btn {
  border-radius: 6px !important;
  font-weight: 600 !important;
  transition: all 0.15s !important;
}
.swagger-ui .btn.execute {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 24px !important;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3) !important;
}
.swagger-ui .btn.execute:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 10px rgba(59,130,246,0.4) !important;
}
.swagger-ui .btn.cancel { color: #ef4444 !important; border-color: #ef4444 !important; }

/* ── Response ── */
.swagger-ui .responses-inner { background: transparent !important; }
.swagger-ui .response-col_status { color: #e2e8f0 !important; }
.swagger-ui .response-col_description { color: #94a3b8 !important; }
.swagger-ui .response-col_description__inner p { color: #94a3b8 !important; }

.swagger-ui .responses-table .response {
  background: #1e293b !important;
  border-radius: 6px !important;
}

.swagger-ui .highlight-code .microlight {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border: 1px solid #334155 !important;
  border-radius: 8px !important;
  font-size: 13px !important;
}

/* ── Models ── */
.swagger-ui .model-box {
  background: #1e293b !important;
  border-radius: 8px !important;
}
.swagger-ui .model { color: #e2e8f0 !important; }
.swagger-ui .model-title { color: #f1f5f9 !important; }
.swagger-ui .prop-type { color: #38bdf8 !important; }
.swagger-ui .prop-format { color: #a78bfa !important; }

.swagger-ui section.models {
  border: 1px solid #334155 !important;
  border-radius: 10px !important;
  background: #1e293b !important;
}
.swagger-ui section.models h4 { color: #e2e8f0 !important; border-color: #334155 !important; }
.swagger-ui section.models .model-container { background: #0f172a !important; border-radius: 6px !important; }

/* ── Filter ── */
.swagger-ui .filter .operation-filter-input {
  background: #1e293b !important;
  border: 1px solid #475569 !important;
  color: #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
}
.swagger-ui .filter .operation-filter-input::placeholder { color: #64748b !important; }

/* ── Request Duration ── */
.swagger-ui .response-col_links {
  color: #94a3b8 !important;
}

/* ── Modal / Dialog ── */
.swagger-ui .dialog-ux .modal-ux {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}
.swagger-ui .dialog-ux .modal-ux-header h3 { color: #f1f5f9 !important; }
.swagger-ui .dialog-ux .modal-ux-content p { color: #94a3b8 !important; }
.swagger-ui .dialog-ux .modal-ux-header { border-bottom: 1px solid #334155 !important; }

/* ── Scrollbar ── */
.swagger-ui ::-webkit-scrollbar { width: 8px; height: 8px; }
.swagger-ui ::-webkit-scrollbar-track { background: #0f172a; }
.swagger-ui ::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.swagger-ui ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Tab Headers ── */
.swagger-ui .tab li { color: #94a3b8 !important; }
.swagger-ui .tab li.active { color: #3b82f6 !important; }
.swagger-ui .tab li:first-of-type::after { background: #334155 !important; }

/* ── Loading ── */
.swagger-ui .loading-container .loading::after {
  color: #64748b !important;
}

/* ── Try it out response ── */
.swagger-ui .live-responses-table .response-col_status { color: #22c55e !important; }

/* ── Copy to clipboard ── */
.swagger-ui .copy-to-clipboard { background: #334155 !important; border-radius: 4px !important; }
.swagger-ui .copy-to-clipboard button { color: #94a3b8 !important; }

/* ── Links ── */
.swagger-ui a { color: #3b82f6 !important; }
.swagger-ui a:hover { color: #60a5fa !important; }

/* ── Wrapper max width ── */
.swagger-ui .wrapper {
  max-width: 1200px !important;
  padding: 0 20px !important;
}

/* ── Version stamp (bottom) ── */
.swagger-ui .info hgroup.main a {
  color: #64748b !important;
}
