/* BASE, VARIABLES */
:root {
  --light-bg: #fafafa;
  --text-primary: #374151;
  --text-accent: #5f6178;
  --light-gray: #5f617866;
  --green-indicator: #22c55e;

  --badge-bg: #58b20770;
  --badge-text: #58b207;

  font-family: Poppins, sans-serif;
  font-size: clamp(0.75rem, 0.6994rem + 0.2532vw, 0.875rem);
  font-weight: 400;

  color-scheme: light;
  color: var(--text-primary);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

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

html {
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0em;
}

img {
  display: block;
  max-width: 100%;
}

/* MAIN STYLES */
.widget-container {
  position: relative;
  display: flex;
  border-radius: 10px;
  background-color: var(--light-bg);
  padding: 1em 0;
  text-decoration: none;
  color: inherit;
  flex-wrap: wrap;
  align-items: center;

  gap: 2em;
}

.cc-icon {
  width: 3rem;
  height: 3rem;
  position: absolute;
  padding: 0.5em;
  border-radius: 99999px;
  background: white;
  right: 0.5em;
  top: 0.5em;
}

.widget-section {
  display: flex;
  flex-direction: column;
  padding: 0 2em;
}

.widget-section:first-child {
  padding-left: 2em;
}

.widget-section:last-child {
  padding-right: 2em;
}

.widget-section h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

[data-disabled] {
  display: none;
}

.general-section h1 {
  margin: 0;
}

.sensor-name {
  display: flex;
  align-items: center;
  position: relative;
  width: fit-content;
}

.sensor-info p {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.address-info {
  display: flex;
  align-items: center;
  gap: 0.75em;
  font-size: 0.85rem;
}

.address-info p {
  margin: 0;
}

.address-info svg {
  height: 1.5rem;
  object-fit: contain;
}

.indicator-items {
  display: flex;
  gap: 1.5em;
  align-items: flex-start;
}

.indicator-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.indicator-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 1em;
  border-radius: 100%;
  border: 2px solid var(--light-gray);
}

.indicator-icon svg {
  max-width: 100%;
  object-fit: contain;
}

.indicator-icon span {
  font-weight: 700;
  font-size: 1rem;
}

.indicator-value {
  font-size: 1.2rem;
  margin-top: 0.25rem;
  text-align: center;
}

.badge {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.1em 0.5em;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.5rem;
  text-transform: uppercase;
}

@media screen and (max-width: 600px) {
  .logo {
    max-width: 100px;
  }

  .logo svg {
    width: 100%;
    object-fit: contain;
  }

  .widget-section {
    padding: 0 1em;
  }
}

@media screen and (max-width: 500px) {
  .indicator-icon.with-icon {
    display: none;
  }

  .indicator-items.indicator-items--weather {
    flex-direction: column;
    gap: 0.75em;
    align-items: center;
  }

  .widget-section {
    padding: 0 1em;
  }

  .indicator-items {
    gap: 1em;
  }

  .widget-container {
    align-items: center;
    justify-content: center;
  }
}

@media screen and (min-width: 1320px) {
  .widget-section {
    padding: 0 4em;
  }

  .indicator-items {
    gap: 3em;
  }
}

@-webkit-keyframes ping {
  75%,
  to {
    transform: scale(2);
    opacity: 0;
  }
}
@keyframes ping {
  75%,
  to {
    transform: scale(2);
    opacity: 0;
  }
}

.online-indicator {
  display: flex;
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  top: 50%;
  right: -1.5em;
  transform: translateY(-50%);
}

.online-indicator .ping {
  -webkit-animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
  position: absolute;
  display: inline-flex;
  height: 100%;
  width: 100%;
  border-radius: 100%;
  background-color: #4ade80;
  opacity: 0.75;
}

.online-indicator .dot {
  position: relative;
  display: inline-flex;
  border-radius: 100%;
  width: 0.75rem;
  height: 0.75rem;
  background-color: #22c55e;
}
