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

:root{
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-bg-dark: rgba(0, 0, 0, 0.8);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-border2: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.22);
  --glass-shadow: rgba(0, 0, 0, 0.18);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --uv: #ffffff;
  --uv-dim: rgba(255, 149, 0, 0.12);
  --temp: #ffffff;
  --temp-dim: rgba(255, 59, 48, 0.12);
  --hum: #ffffff;
  --hum-dim: rgba(34, 88, 189, 0.12);
  --green: #34c759;
  --card-radius: 18px;
  --hstat-bg-alpha-1: 0.08;
  --hstat-bg-alpha-2: 0.04;
  --hstat-bg-alpha-3: 0.015;
  --hstat-overlay-alpha-1: 0.08;
  --hstat-overlay-alpha-2: 0.028;
  --hstat-overlay-alpha-3: 0.004;
}

html, body{

  min-height: 100vh;
   font-family: 'Montserrat', sans-serif;
    color: #ffffff; 
    overflow-x: hidden;
    margin: 0;

    background: 
        radial-gradient(circle at 10% 10%, rgba(253, 255, 134, 0.534) 0%, transparent 20%),
        radial-gradient(circle at 5% 5%, rgba(255, 153, 1, 0.795) 0%, transparent 10%),
        radial-gradient(circle at 90% 90%, rgba(11, 22, 70, 0.74) 0%, transparent 30%),
        radial-gradient(circle at 100% 90%, rgb(2, 2, 54) 0%, transparent 10%),
        linear-gradient(180deg, #74747463 0%, #5471aa 100%);
        
    background-attachment: fixed;
    transition: background 0.8s ease-in-out;
    z-index: -2;
}

body{
  position: relative;
  min-height: 100vh;
}

body::before{
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(0, 0, 0, 0.18) 100%);
  pointer-events: none;
  z-index: -1;
}

.glass{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.10) 38%,
      rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(10px) saturate(1.55) brightness(1.12);
  -webkit-backdrop-filter: blur(2px) saturate(1.55) brightness(1.12);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: var(--card-radius);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.glass::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg,
      rgba(255, 255, 255, 0.24) 0%,
      rgba(255, 255, 255, 0.10) 24%,
      rgba(255, 255, 255, 0.04) 52%,
      rgba(255, 255, 255, 0.01) 100%);
  pointer-events: none;
}

.glass::after{
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--card-radius) - 1px);
  backdrop-filter: saturate(0.72) brightness(0.92);
  -webkit-backdrop-filter: saturate(0.72) brightness(0.92);
  background:
    linear-gradient(180deg, rgba(140, 150, 165, 0.10), rgba(140, 150, 165, 0.04)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.10), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.05), transparent 30%);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.62;
  z-index: 0;
}

.glass > *{
  position: relative;
  z-index: 1;
}

.dash{
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  position: relative;
  z-index: 1;
}

.page-wrapper{
  padding-top: 80px;
}

.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.logo{
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.logo span{
  color: var(--uv);
}

.live-badge{
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: var(--green);
  background: rgba(52, 199, 89, 0.12);
  border: 0.5px solid var(--glass-border);
  border-radius: 20px;
  padding: 4px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.live-dot{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse{
  0%,100%{
    opacity: 1;
    transform: scale(1);
  }
  50%{
    opacity: 0.4;
    transform: scale(0.8);
  }
}

.clock{
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Ensure Bootstrap modal text stays readable against light modal surfaces. */
#dashboardInfoModal .modal-content{
  color: #1f2937;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

#dashboardInfoModal .modal-header,
#dashboardInfoModal .modal-footer{
  border-color: rgba(15, 23, 42, 0.14);
}

#dashboardInfoModal .modal-title,
#dashboardInfoModal .modal-body{
  color: #111827;
}

.hero{
  padding: 24px;
  margin-bottom: 16px;
  position: relative;
  backdrop-filter: blur(12px) saturate(1.2) brightness(1.06);
  -webkit-backdrop-filter: blur(12px) saturate(1.2) brightness(1.06);
  background:
    linear-gradient(135deg,
      rgba(18, 22, 28, 0.38) 0%,
      rgba(22, 28, 36, 0.30) 45%,
      rgba(26, 34, 44, 0.24) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.hero::before{
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 149, 0, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-title{
  position: relative;
  z-index: 1;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.hero-title .accent{
  color: var(--uv);
}

.hero-sub{
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero-stats{
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hstat {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 16px 14px;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.2s ease;
  
  /* Lighter glass to contrast against the dark ambient background */
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hstat::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, var(--hstat-overlay-alpha-1)),
    rgba(255, 255, 255, var(--hstat-overlay-alpha-2)) 35%,
    rgba(255, 255, 255, var(--hstat-overlay-alpha-3))
  );
  pointer-events: none;
  z-index: 1;
}

.hstat::after{
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  backdrop-filter: saturate(0.75) brightness(0.94);
  -webkit-backdrop-filter: saturate(0.75) brightness(0.94);
  background: linear-gradient(180deg, rgba(140, 150, 165, 0.10), rgba(140, 150, 165, 0.03));
  pointer-events: none;
  z-index: 0;
}

.hstat:hover {
  transform: translateY(-4px) scale(1.02);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hstat-label,
.hstat-val,
.hstat-sub,
.hstat-bar{
  position: relative;
  z-index: 1;
}

.hstat-label{
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.hstat-val {
  font-size: 34px; 
  font-weight: 700; 
  line-height: 1;
  letter-spacing: -0.03em; 
  color: var(--text-primary);
}

.hstat-unit{
  font-size: 13px;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 2px;
}

.hstat-sub{
  font-size: 11px;
  margin-top: 4px;
  opacity: 0.7;
  color: var(--text-primary);
}

.hstat-bar{
  height: 3px;
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.hstat-fill{
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

.uv-c .hstat-label,
.uv-c .hstat-val{
  color: var(--uv);
}
.uv-c .hstat-fill{
  background: var(--uv);
}

.temp-c .hstat-label,
.temp-c .hstat-val{
  color: var(--temp);
}
.temp-c .hstat-fill{
  background: var(--temp);
}

.hum-c .hstat-label,
.hum-c .hstat-val{
  color: var(--hum);
}
.hum-c .hstat-fill{
  background: var(--hum);
}

.grid2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.grid3{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel{
  padding: 18px 16px;
}

.panel-header{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-title{
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.panel-badge{
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 0.5px solid;
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.badge-uv{
  color: var(--uv);
  border-color: rgba(255, 149, 0, 0.25);
  background: var(--uv-dim);
}

.badge-temp{
  color: var(--temp);
  border-color: rgba(255, 59, 48, 0.25);
  background: var(--temp-dim);
}

.badge-hum{
  color: var(--hum);
  border-color: rgba(48, 176, 192, 0.25);
  background: var(--hum-dim);
}

.chart-wrap{
  position: relative;
  width: 100%;
  height: 160px;
  z-index: 1;
}

.chart-wrap-tall{
  position: relative;
  width: 100%;
  height: 200px;
}

.gauge-wrap{
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 0;
}

.gauge-val{
  font-size: 32px;
  font-weight: 800;
  margin-top: -10px;
  color: var(--text-primary);
}

.gauge-label{
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-family: 'Montserrat', sans-serif;
}

.alert-row{
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.alert-card{
  flex: 1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 16px;
  padding: 12px 14px;
  background:
    linear-gradient(145deg,
      rgba(255, 255, 255, 0.10) 50%,
      rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(20px) saturate(1.45) brightness(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.45) brightness(1.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.alert-card::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  pointer-events: none;
  z-index: 1;
}

.alert-card::after{
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  backdrop-filter: saturate(0.75) brightness(0.94);
  -webkit-backdrop-filter: saturate(0.75) brightness(0.94);
  background: linear-gradient(180deg, rgba(140, 150, 165, 0.10), rgba(140, 150, 165, 0.04));
  pointer-events: none;
  z-index: 0;
}

.alert-uv{
  border-color: rgba(255, 149, 0, 0.24);
}
.alert-temp{
  border-color: rgba(255, 59, 48, 0.24);
}
.alert-hum{
  border-color: rgba(48, 176, 192, 0.24);
}

.alert-icon,
.alert-title,
.alert-desc{
  position: relative;
  z-index: 1;
}

.alert-icon{
  font-size: 18px;
  margin-bottom: 4px;
}

.alert-title{
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.alert-desc{
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.5;
}

.sensor-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-top: 4px;
  border-radius: 16px;
}

.sf-item{
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .grid2{
    grid-template-columns: 1fr;
  }

  .grid3{
    grid-template-columns: 1fr;
  }

  .hero-stats{
    grid-template-columns: 1fr;
  }
}
