/*
 * WaterEV Global Styles
 * Supplements Bootstrap 5 + base.html inline CSS
 */

/* ── Print styles ── */
@media print {
  .navbar-waterev, .site-footer, .topbar { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}

/* ── Utility classes ── */
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Loading spinner overlay ── */
.page-loading {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

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

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--water-blue);
  outline-offset: 2px;
}

/* ── Tooltips ── */
[data-tooltip] {
  position: relative;
  cursor: help;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  padding: .3rem .7rem;
  border-radius: 6px;
  font-size: .75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  margin-bottom: 6px;
  z-index: 100;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Back to top ── */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 42px;
  height: 42px;
  background: var(--water-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,119,182,.4);
  transition: transform .2s, background .2s;
}
#backToTop:hover {
  background: var(--water-dark);
  transform: translateY(-2px);
}
#backToTop.show { display: flex; }

/* ── Custom scrollbar ── */
.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--water-blue);
  border-radius: 2px;
}

/* ── Table styles ── */
.water-table { width: 100%; border-collapse: collapse; }
.water-table th {
  background: var(--water-dark);
  color: #fff;
  padding: .7rem 1rem;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.water-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.water-table tr:hover td { background: var(--bg-light); }

/* ── Stars rating ── */
.stars { color: #f4a900; letter-spacing: 2px; }
.stars-empty { color: #ddd; }

/* ── Badge variants ── */
.badge-excellent { background: #d1fae5; color: #065f46; }
.badge-good      { background: #dbeafe; color: #1e40af; }
.badge-fair      { background: #fef3c7; color: #92400e; }
.badge-poor      { background: #fee2e2; color: #991b1b; }

/* ── Image aspect ratios ── */
.ratio-card  { aspect-ratio: 4/3; object-fit: cover; }
.ratio-hero  { aspect-ratio: 16/9; object-fit: cover; }
.ratio-thumb { aspect-ratio: 1/1; object-fit: cover; }
