/* ============================================================
   Jamurnd IoT Dashboard — Pastel Soft Blue & Soft Pink Light Theme
   ============================================================ */

:root {
  /* Soft Blue & Soft Pink Palette */
  --jm-soft-blue: #38bdf8;
  --jm-soft-blue-dark: #0284c7;
  --jm-soft-blue-bg: #e0f2fe;

  --jm-soft-pink: #f472b6;
  --jm-soft-pink-dark: #db2777;
  --jm-soft-pink-bg: #fce7f3;

  /* Gradients */
  --jm-bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #fdf2f8 50%, #fce7f3 100%);
  --jm-gradient-brand: linear-gradient(135deg, #38bdf8 0%, #f472b6 100%);
  --jm-gradient-brand-subtle: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(244, 114, 182, 0.15) 100%);
  --jm-gradient-hover: linear-gradient(135deg, #0ea5e9 0%, #ec4899 100%);

  /* Light Theme Surfaces (Frosted Glass Effect) */
  --jm-bg-surface: rgba(255, 255, 255, 0.88);
  --jm-bg-surface-elevated: #f8fafc;
  --jm-bg-surface-hover: #f1f5f9;
  --jm-border: rgba(203, 213, 225, 0.7);
  --jm-border-subtle: rgba(226, 232, 240, 0.8);
  --jm-border-pink: rgba(244, 114, 182, 0.35);
  --jm-border-blue: rgba(56, 189, 248, 0.35);

  /* Typography (High Contrast, Crisp & Readable) */
  --jm-text-main: #0f172a;
  --jm-text-muted: #64748b;
  --jm-text-subtle: #94a3b8;
  --jm-radius-lg: 18px;
  --jm-radius-md: 12px;
}

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

body {
  background: var(--jm-bg-gradient);
  background-attachment: fixed;
  color: var(--jm-text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Desktop Viewport Wrapper ──────────────── */
.container-xxl {
  max-width: 1400px;
}

/* ── Top Navigation Bar ────────────────────── */
.navbar-jamurnd {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(224, 231, 255, 0.9);
  padding: 0.85rem 0;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.08);
}

.brand-badge {
  background: var(--jm-gradient-brand);
  color: #fff;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.35rem;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}

.navbar-brand-text {
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
  background: var(--jm-gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.status-pill.online {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.status-pill.offline {
  background: #fce7f3;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-dot.online {
  background: #0284c7;
  box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
  animation: pulse-blue 2s infinite;
}

.pulse-dot.offline {
  background: #db2777;
  box-shadow: 0 0 0 0 rgba(219, 39, 119, 0.7);
  animation: pulse-pink 2s infinite;
}

@keyframes pulse-blue {
  0% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(2, 132, 199, 0); }
  100% { box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

@keyframes pulse-pink {
  0% { box-shadow: 0 0 0 0 rgba(219, 39, 119, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(219, 39, 119, 0); }
  100% { box-shadow: 0 0 0 0 rgba(219, 39, 119, 0); }
}

/* ── Modern Tabs Nav ───────────────────────── */
.nav-pills-jamurnd {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(224, 231, 255, 0.9);
  padding: 5px;
  border-radius: 14px;
  display: inline-flex;
  gap: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.nav-pills-jamurnd .nav-link {
  color: var(--jm-text-muted);
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pills-jamurnd .nav-link:hover {
  color: var(--jm-text-main);
  background: rgba(255, 255, 255, 0.8);
}

.nav-pills-jamurnd .nav-link.active {
  background: var(--jm-gradient-brand);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.35);
}

/* ── Environmental Condition Banner ────────── */
.mushroom-alert-banner {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--jm-border-blue);
  border-radius: var(--jm-radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.06);
}

.mushroom-alert-banner.warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.mushroom-alert-banner.danger {
  background: #fff1f2;
  border-color: #fecdd3;
}

/* ── Metric Cards ──────────────────────────── */
.card-jamurnd {
  background: var(--jm-bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--jm-radius-lg);
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.1), 0 8px 10px -6px rgba(244, 114, 182, 0.1);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.card-jamurnd:hover {
  border-color: var(--jm-soft-blue);
  box-shadow: 0 14px 30px -4px rgba(56, 189, 248, 0.2), 0 10px 15px -5px rgba(244, 114, 182, 0.2);
  transform: translateY(-2px);
}

/* Card Icon Box */
.card-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.card-icon-box.temp {
  background: #fce7f3;
  color: var(--jm-soft-pink-dark);
}

.card-icon-box.hum {
  background: #e0f2fe;
  color: var(--jm-soft-blue-dark);
}

.card-icon-box.sensor {
  background: #e0f2fe;
  color: var(--jm-soft-blue-dark);
}

.card-icon-box.camera {
  background: #fce7f3;
  color: var(--jm-soft-pink-dark);
}

.card-icon-box.db {
  background: var(--jm-gradient-brand-subtle);
  color: var(--jm-soft-blue-dark);
}

.card-metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 4px;
}

.card-metric-label {
  font-size: 0.78rem;
  color: var(--jm-text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.8px;
}

/* Mini Stat Row */
.mini-stat-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--jm-radius-md);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.mini-stat-card:hover {
  background: #ffffff;
  border-color: var(--jm-soft-blue);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.08);
}

.mini-stat-label {
  font-size: 0.74rem;
  color: var(--jm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mini-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2px;
}

/* ── Camera Box ────────────────────────────── */
.camera-box {
  background: #000;
  border-radius: var(--jm-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}

.camera-header-bar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  color: var(--jm-text-main);
}

.camera-viewport {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #0f172a;
}

.camera-viewport img,
.camera-viewport .camera-empty-state {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.camera-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  gap: 12px;
}

/* ── Chart Container ───────────────────────── */
.chart-container-box {
  background: var(--jm-bg-surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--jm-radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.1), 0 8px 10px -6px rgba(244, 114, 182, 0.1);
}

.chart-canvas-wrapper {
  position: relative;
  height: 330px;
  width: 100%;
}

/* Range Switcher Buttons */
.btn-group .chart-range-btn {
  border-color: #cbd5e1;
  color: var(--jm-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  background: #ffffff;
}

.btn-group .chart-range-btn.active {
  background: var(--jm-gradient-brand);
  border-color: transparent;
  color: #fff;
}

/* ── Table Styling ─────────────────────────── */
.table-jamurnd {
  color: var(--jm-text-main);
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table-jamurnd thead th {
  background: #f8fafc;
  color: var(--jm-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 18px;
  border-bottom: 2px solid #e2e8f0;
}

.table-jamurnd tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  vertical-align: middle;
  background: #ffffff;
}

.table-jamurnd tbody tr:hover td {
  background: #f8fafc;
}

/* Condition Badges */
.badge-status-optimal {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-status-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-status-danger {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Backup Action Cards ───────────────────── */
.backup-card {
  background: var(--jm-bg-surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--jm-radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.08);
  transition: all 0.25s ease;
}

.backup-card:hover {
  border-color: var(--jm-soft-pink);
  box-shadow: 0 14px 30px -4px rgba(244, 114, 182, 0.2);
  transform: translateY(-2px);
}

/* ── Buttons (Soft Blue + Pink) ────────────── */
.btn-jamurnd-primary {
  background: var(--jm-gradient-brand);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 22px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
}

.btn-jamurnd-primary:hover {
  background: var(--jm-gradient-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(244, 114, 182, 0.45);
}

.btn-jamurnd-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--jm-text-main);
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 22px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-jamurnd-secondary:hover {
  background: #f8fafc;
  border-color: var(--jm-soft-blue);
  color: var(--jm-soft-blue-dark);
}

/* Text Accent Classes */
.text-soft-pink {
  color: #db2777 !important;
}

.text-soft-blue {
  color: #0284c7 !important;
}

/* ── Footer ─────────────────────────────────── */
.footer-jamurnd {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(224, 231, 255, 0.9);
  padding: 1.25rem 0;
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--jm-text-muted);
}
