.fyp-weather {
  --fyp-weather-primary-color: var(--fyplugins-primary-color, #ec8b00);
  --fyp-weather-primary-color-contrast: var(--fyplugins-primary-color-contrast, #ffffff);
  --fyp-weather-primary-color-gradient: var(--fyplugins-primary-color-gradient, #f6d365);
  --fyp-weather-border-radius: var(--fyplugins-border-radius, 0);
  --fyp-weather-box-shadow: var(--fyplugins-box-shadow, none);
  --fyp-weather-panel-bg: rgba(255, 255, 255, 0.14);
  --fyp-weather-panel-border: rgba(255, 255, 255, 0.22);

  background: linear-gradient(135deg, var(--fyp-weather-primary-color-gradient) 0%, var(--fyp-weather-primary-color) 100%);
  color: var(--fyp-weather-primary-color-contrast);
  padding: 24px;
  border-radius: var(--fyp-weather-border-radius);
  box-shadow: var(--fyp-weather-box-shadow);
  max-width: 350px;
  margin: 20px auto;
  position: relative;
  overflow: hidden;
  line-height: 1.3;
  animation: fadeInUp 0.6s ease-out;
}

.fyp-weather::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 72%);
  pointer-events: none;
}

.fyp-weather-city {
  margin: 0 0 18px 0;
  font-size: 24px;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.fyp-weather-temp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.fyp-weather-temp img {
  width: 78px;
  height: 78px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.fyp-weather-temp .temperature {
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.28);
}

.fyp-weather-description {
  text-align: center;
  font-size: 17px;
  margin-bottom: 18px;
  text-transform: capitalize;
  font-weight: 400;
  opacity: 0.92;
}

.fyp-weather-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--fyp-weather-panel-bg);
  padding: 14px;
  border-radius: calc(var(--fyp-weather-border-radius) * 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--fyp-weather-panel-border);
}

.fyp-weather-details:has(> :only-child) {
  justify-content: center;
}

.fyp-weather-details > :only-child {
  margin-left: auto;
  margin-right: auto;
}

/* Compact: city + temperature only, reduced footprint */
.fyp-weather.fyp-weather-compact {
  max-width: 240px;
  padding: 16px 18px;
}

.fyp-weather.fyp-weather-compact .fyp-weather-city {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  opacity: 0.95;
}

.fyp-weather.fyp-weather-compact .fyp-weather-temp {
  margin-bottom: 0;
}

.fyp-weather.fyp-weather-compact .fyp-weather-temp .temperature {
  font-size: 40px;
  font-weight: 700;
  text-shadow: none;
}

/* Default: balanced card with quick summary blocks */
.fyp-weather.fyp-weather-default .fyp-weather-details.fyp-weather-details-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  align-items: stretch;
  padding: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.fyp-weather.fyp-weather-default .fyp-weather-details-list .detail-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: calc(var(--fyp-weather-border-radius) * 0.6);
  background: var(--fyp-weather-panel-bg);
  border: 1px solid var(--fyp-weather-panel-border);
}

.fyp-weather.fyp-weather-default .fyp-weather-details-list .detail-row .label,
.fyp-weather.fyp-weather-default .fyp-weather-details-list .detail-row .value {
  display: block;
  text-align: left;
}

.fyp-weather.fyp-weather-default .fyp-weather-details-list .detail-row .label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
}

.fyp-weather.fyp-weather-default .fyp-weather-details-list .detail-row .value {
  font-size: 16px;
  font-weight: 700;
  opacity: 1;
}

/* Detailed: richer hierarchy and tabular details */
.fyp-weather.fyp-weather-detailed {
  max-width: 430px;
}

.fyp-weather.fyp-weather-detailed .fyp-weather-detailed-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.fyp-weather.fyp-weather-detailed .detailed-city-wrap {
  min-width: 0;
}

.fyp-weather.fyp-weather-detailed .fyp-weather-city {
  margin: 0;
  text-align: left;
}

.fyp-weather.fyp-weather-detailed .fyp-weather-description {
  margin: 6px 0 0 0;
  text-align: left;
  font-size: 14px;
  opacity: 0.95;
}

.fyp-weather.fyp-weather-detailed .detailed-temp-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 8px 10px;
  border-radius: calc(var(--fyp-weather-border-radius) * 0.6);
  background: var(--fyp-weather-panel-bg);
  border: 1px solid var(--fyp-weather-panel-border);
}

.fyp-weather.fyp-weather-detailed .detailed-temp-wrap img {
  width: 54px;
  height: 54px;
}

.fyp-weather.fyp-weather-detailed .detailed-temp-wrap .temperature {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  text-shadow: none;
}

.fyp-weather.fyp-weather-detailed .fyp-weather-details.fyp-weather-details-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  backdrop-filter: none;
  border-radius: calc(var(--fyp-weather-border-radius) * 0.6);
  overflow: hidden;
}

.fyp-weather.fyp-weather-detailed .detail-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width:calc(100% - 16px);
  gap: 12px;
  padding: 12px 14px;
}

.fyp-weather.fyp-weather-detailed .detail-table-row + .detail-table-row {
  border-top: 1px solid var(--fyp-weather-panel-border);
}

.fyp-weather.fyp-weather-detailed .detail-table-row .detail-label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.92;
}

.fyp-weather.fyp-weather-detailed .detail-table-row .detail-value {
  font-size: 15px;
  font-weight: 700;
  opacity: 1;
}

/* Split: visual left metric + right textual details */
.fyp-weather.fyp-weather-split {
  display: grid;
  grid-template-columns: minmax(140px, 38%) minmax(0, 1fr);
  gap: 0;
  padding: 0;
  max-width: 520px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(14, 28, 58, 0.16);
  border-radius: var(--fyp-weather-border-radius);
  overflow: hidden;
  color: inherit;
}

.fyp-weather.fyp-weather-split::before {
  display: none;
}

.fyp-weather.fyp-weather-split .split-panel {
  padding: 20px;
}

.fyp-weather.fyp-weather-split .split-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  border-radius: var(--fyp-weather-border-radius) 0 0 var(--fyp-weather-border-radius);
  background: linear-gradient(140deg, var(--fyp-weather-primary-color-gradient) 0%, var(--fyp-weather-primary-color) 100%);
  color: var(--fyp-weather-primary-color-contrast);
}

.fyp-weather.fyp-weather-split .split-right {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #faf8f4 100%);
  border-radius: 0 var(--fyp-weather-border-radius) var(--fyp-weather-border-radius) 0;
  color: #2b2419;
}

.fyp-weather.fyp-weather-split .split-right::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(31, 80, 192, 0.28);
  border-left: 0;
  border-radius: inherit;
  pointer-events: none;
}

.fyp-weather.fyp-weather-split .icon-wrap img {
  width: 68px;
  height: 68px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(12, 24, 52, 0.28));
}

.fyp-weather.fyp-weather-split .temp-wrap .temperature {
  font-size: 44px;
  letter-spacing: -0.02em;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 3px 8px rgba(14, 28, 58, 0.2);
}

.fyp-weather.fyp-weather-split .fyp-weather-city {
  margin: 0 0 4px 0;
  font-size: clamp(26px, 4.4vw, 34px);
  font-weight: 500;
  text-align: left;
  color: inherit;
  text-shadow: none;
  line-height: 1.05;
  letter-spacing: 0.2px;
  overflow-wrap: anywhere;
}

.fyp-weather.fyp-weather-split .fyp-weather-description {
  margin-bottom: 14px;
  opacity: 0.8;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
}

.fyp-weather.fyp-weather-split .fyp-weather-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.fyp-weather.fyp-weather-split .detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width:calc(100% - 16px);
  padding: 4px 8px 2px 8px;
  border-top: 1px solid var(--fyp-weather-primary-color-gradient);
}

.fyp-weather.fyp-weather-split .detail-row:first-child {
  border-top: 0;
}

.fyp-weather.fyp-weather-split .detail-row .label {
  font-size: 15px;
  font-weight: 600;
  margin-right: 0;
}

.fyp-weather.fyp-weather-split .detail-row .value {
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: var(--fyp-weather-primary-color);
  letter-spacing: -0.02em;
}

@media (max-width: 480px) {
  .fyp-weather {
    margin: 10px;
    padding: 20px;
    max-width: none;
  }

  .fyp-weather.fyp-weather-split {
    grid-template-columns: 1fr;
    border: 0;
  }

  .fyp-weather.fyp-weather-split .split-panel {
    padding: 16px;
  }

  .fyp-weather.fyp-weather-split .split-right {
    border-radius: 0 0 var(--fyp-weather-border-radius) var(--fyp-weather-border-radius);
  }

  .fyp-weather.fyp-weather-split .split-right::before {
    border-left: 1px solid rgba(31, 80, 192, 0.28);
    border-top: 0;
    border-radius: 0 0 var(--fyp-weather-border-radius) var(--fyp-weather-border-radius);
  }

  .fyp-weather.fyp-weather-split .split-left {
    border-radius: var(--fyp-weather-border-radius) var(--fyp-weather-border-radius) 0 0;
  }

  .fyp-weather.fyp-weather-split .fyp-weather-city {
    font-size: 28px;
  }

  .fyp-weather.fyp-weather-split .detail-row .value {
    font-size: 28px;
  }

  .fyp-weather-temp {
    flex-direction: column;
    text-align: center;
  }

  .fyp-weather-details {
    flex-direction: column;
    gap: 14px;
  }

  .fyp-weather.fyp-weather-default .fyp-weather-details.fyp-weather-details-list {
    grid-template-columns: 1fr;
  }

  .fyp-weather.fyp-weather-detailed .fyp-weather-detailed-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .fyp-weather.fyp-weather-detailed .detailed-temp-wrap {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
  }

  .fyp-weather.fyp-weather-compact {
    max-width: none;
    padding: 14px 16px;
  }

  .fyp-weather.fyp-weather-compact .fyp-weather-temp {
    flex-direction: row;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
