/* ═══════════════════════════════════════════════════════
   Hidroponia Monitor – Custom Styles
═══════════════════════════════════════════════════════ */

:root {
  --accent: #198754;
  --accent-hover: #0f5132;
}

/* ── Fontes ─────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #0d1117;
}

code {
  background: #1e2735;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ── Câmera ─────────────────────────────────────────── */
.camera-img {
  display: block;
  background: #111;
  transition: opacity 0.25s ease;
}

.camera-img.loading {
  opacity: 0.4;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  border-radius: 8px;
}

.card-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

/* ── Range inputs ───────────────────────────────────── */
.form-range {
  accent-color: var(--accent);
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar-brand span:first-child {
  font-size: 1.3rem;
  line-height: 1;
}

/* ── Tabs ───────────────────────────────────────────── */
.nav-tabs .nav-link {
  color: #adb5bd;
  border-color: transparent transparent rgba(255,255,255,.1);
}

.nav-tabs .nav-link.active {
  color: #fff;
  background-color: #1a2233;
  border-color: rgba(255,255,255,.1) rgba(255,255,255,.1) #1a2233;
}

.nav-tabs .nav-link:hover:not(.active) {
  color: #fff;
  border-color: transparent transparent rgba(255,255,255,.15);
}

.tab-content > .tab-pane {
  background: #1a2233;
  border: 1px solid rgba(255,255,255,.1);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 1.25rem;
}

/* ── Galeria ─────────────────────────────────────────── */
.gallery-thumb {
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #111;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery-thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 0 0 2px var(--accent);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb .thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.6);
  font-size: 0.6rem;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Badges no navbar ───────────────────────────────── */
#statusBar .badge {
  font-weight: 400;
  font-size: 0.7rem;
}

/* ── Botões extras ──────────────────────────────────── */
.btn-xs {
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  border-radius: 4px;
}

/* ── Disk usage bar ─────────────────────────────────── */
.disk-bar {
  height: 6px;
  border-radius: 3px;
  background: #2d3748;
  overflow: hidden;
}

.disk-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.disk-bar-fill.warn { background: #ffc107; }
.disk-bar-fill.danger { background: #dc3545; }

/* ── Responsive tweaks ──────────────────────────────── */
@media (max-width: 576px) {
  .camera-img { max-height: 50vh !important; }
  .tab-content > .tab-pane { padding: 0.75rem; }
}
