/* =====================================================
   3WA Connection (斷線終結者) — Dark Tech Theme (BS5)
   ===================================================== */
:root {
  --conn-bg       : #090e17;
  --conn-card     : #111a2e;
  --conn-card-inner: #0b1120;
  --conn-border   : #23334d;
  --conn-glow     : #38bdf8;
  --conn-glow-dim : rgba(56, 189, 248, 0.2);
  --conn-text     : #f1f5f9;
  --conn-muted    : #94a3b8;
  --conn-radius   : 12px;
}

html, body {
  width: 100%;
  min-height: 100% !important;
  height: auto !important;
  background-color: var(--conn-bg) !important;
  color: var(--conn-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

.chart_class {
  width: 100%;
  height: 460px;
}
.chart_mid {
  width: 100%;
  height: 360px;
}

.thetableOff {
  font-size: 13px;
  margin: 0 auto;
  color: var(--conn-text);
}
.thetableOff thead th {
  padding: 8px 12px;
  text-align: center;
  background: var(--conn-card-inner);
  border-color: var(--conn-border);
  color: #ffffff;
}
.thetableOff tbody td {
  padding: 8px 12px;
  text-align: center;
  border-color: var(--conn-border);
}

.conn-stat-card {
  background: var(--conn-card);
  border: 1px solid var(--conn-border);
  border-radius: var(--conn-radius);
  padding: 16px 12px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.conn-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--conn-glow);
}
.conn-stat-card .stat-icon {
  font-size: 30px;
  margin-bottom: 6px;
  display: block;
}
.conn-stat-card small {
  color: var(--conn-muted);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 4px;
}
.conn-stat-card h4 {
  margin: 0;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
}

.conn-section-card {
  background: var(--conn-card);
  border: 1px solid var(--conn-border);
  border-radius: var(--conn-radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.conn-section-title {
  color: var(--conn-glow);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 18px;
  letter-spacing: 1px;
}

.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-online {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}
.status-offline {
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: conn-blink 1s infinite;
}
@keyframes conn-blink {
  50% { opacity: 0.35; }
}

#offLineDivtables {
  text-align: center;
}
#offLineDivtables table {
  margin: 0 auto;
}
.table-summary {
  margin-bottom: 14px;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: rgba(9, 14, 23, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}
.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.loading-spinner {
  width: 80px;
  height: 80px;
  position: relative;
}
.loading-spinner .ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid transparent;
}
.loading-spinner .ring:nth-child(1) {
  border-top-color: #38bdf8;
  animation: spin 1.2s linear infinite;
}
.loading-spinner .ring:nth-child(2) {
  border-right-color: #f59e0b;
  animation: spin 1.6s linear infinite reverse;
  width: 60px;
  height: 60px;
  top: 10px;
  left: 10px;
}
.loading-spinner .ring:nth-child(3) {
  border-bottom-color: #ef4444;
  animation: spin 2s linear infinite;
  width: 40px;
  height: 40px;
  top: 20px;
  left: 20px;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}
.loading-text {
  margin-top: 25px;
  color: #f1f5f9;
  font-size: 18px;
  letter-spacing: 3px;
  animation: pulse 1.5s ease-in-out infinite;
}
.loading-text .dot {
  animation: dotBounce 1.4s ease-in-out infinite;
  display: inline-block;
}
.loading-text .dot:nth-child(2) { animation-delay: 0.2s; }
.loading-text .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}
.loading-bar {
  margin-top: 20px;
  width: 220px;
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
}
.loading-bar-inner {
  width: 30%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #38bdf8, #f59e0b, #ef4444, #10b981);
  background-size: 300% 100%;
  animation: barSlide 2s ease-in-out infinite;
}
@keyframes barSlide {
  0%   { transform: translateX(-100%); background-position: 0% 0%; }
  50%  { background-position: 100% 0%; }
  100% { transform: translateX(400%); background-position: 0% 0%; }
}

@media (max-width: 768px) {
  .chart_class { height: 320px; }
  .chart_mid   { height: 260px; }
  .thetableOff { font-size: 11px; }
  .conn-stat-card h4 { font-size: 14px; }
}
