/* ==================================== Root and All ==================================== */

:root {
  /* Base colors */
  --plum-dark: #43283c;
  --plum: #5a3344;
  --rosewood: #7f4652;
  --dusty-rose: #b06464;
  --peach-rose: #ec9079;

  /* Lighter tints */
  --plum-tint: #6d4e61;
  --rosewood-tint: #a66b75;
  --dusty-rose-tint: #cc8a88;
  --peach-tint: #f4b5a2;

  /* Darker shades */
  --plum-shade: #2e1c2a;
  --rosewood-shade: #5d333a;
  --dusty-rose-shade: #8f4e4e;
  --peach-shade: #c8705d;

  /* Neutrals */
  --off-white: #faf8f7;
  --soft-gray: #d7d5d4;
  --charcoal: #2b2b2b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
    sans-serif;
}
html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--peach-tint);
  color: var(--off-white);
}

/* ==================================== Header, Main, and Footer  ==================================== */

main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

footer {
  padding: 10px;
  font-weight: 500;
  color: var(--dusty-rose-shade);
  margin-top: auto;
}

header {
  background-color: var(--peach-rose);
  padding: 20px 30px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 2px solid var(--dusty-rose);
}

header > span {
  font-weight: 600;
  font-size: 2rem;
  color: var(--off-white);
}

/* ==================================== Controls Section ==================================== */

.controls-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 0 40px;
  padding-top: 30px;
  width: 70%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ------------ Search Bar ------------*/

.search-bar {
  justify-self: start;
}

.search-bar form {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--off-white);
  border: 2px solid var(--dusty-rose);
  border-radius: 18px;
  padding: 8px 12px;
}

.search-bar input[type='search'] {
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.2rem;
  color: var(--charcoal);
  width: 220px;
}

.fa-solid {
  color: var(--charcoal);
}

/* ------------ Toggle Units Button ------------*/

.toggle-units {
  font-size: 1.2rem;
  display: flex;
  gap: 0;
  background-color: var(--dusty-rose-tint);
  padding: 0;
  border: 2px solid var(--dusty-rose);
  border-radius: 18px;
  cursor: pointer;
  justify-self: end;
  overflow: hidden;
  width: 110px;
  color: var(--off-white);
}

.F-units,
.C-units {
  padding: 6px 12px;
  flex: 1;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 600;
  user-select: none;
}

.F-units.active,
.C-units.active {
  background-color: var(--rosewood-tint);
  font-weight: 700;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.F-units:not(.active):hover,
.C-units:not(.active):hover {
  background-color: var(--rosewood);
  font-weight: 700;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.F-units:not(.active):active,
.C-units:not(.active):active {
  background-color: var(--rosewood-shade);
}

.F-units.active,
.F-units:not(.active):hover {
  border-radius: 14px 0 0 14px;
}

.C-units.active,
.C-units:not(.active):hover {
  border-radius: 0 14px 14px 0;
}

/* ==================================== Main Grid ==================================== */

.main-grid {
  display: grid;
  grid-template-rows: auto auto;
  gap: 30px;
  padding: 40px;
  padding-top: 15px;
  width: 70%;
  max-width: 1200px;
  margin: 0 auto;
}

.today {
  background-color: var(--off-white);
  border: 2px solid var(--dusty-rose);
  border-radius: 20px;
  padding: 30px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 26px;
}

/* ------------ Left side ------------*/

.left-side {
  display: grid;
  align-content: start;
  gap: 16px;
  align-content: space-between;
}

.temps {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
}

.temp-amount {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--plum-dark);
}

.temp-and-hi-low {
  display: flex;
  flex-direction: column;
}

.conditions,
.current-date {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--plum-dark);
}

.hi-low {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--plum-dark);
  display: flex;
  gap: 8px;
  align-items: center;
}

.hi-amount,
.low-amount {
  color: var(--plum-dark);
}

.location {
  margin-top: 16px;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 600;
  color: var(--plum-dark);
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-transform: capitalize;
}

.left-side img {
  justify-self: center;
  width: 50%;
  height: auto;
}

/* ------------ Right side ------------*/

.right-side {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 0;
  padding: 0;
  border-radius: 15px;
  background-color: var(--rosewood-tint);
  border: 2px solid var(--peach-rose);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


.right-side .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.right-side .row:last-child {
  border-bottom: none;
}

.right-side .row:hover {
  background: rgba(255, 255, 255, 0.12);
}

.right-side .row p:first-child,
.right-side .row p:last-child {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--off-white);
}

/* ------------Bottom row (+1 / +2 / +3) ------------ */

.next-3-days {
  background-color: var(--off-white);
  border: 2px solid var(--dusty-rose);
  border-radius: 20px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

.next-3-days > div {
  background-color: var(--rosewood-tint);
  border: 1px solid var(--dusty-rose);
  border-radius: 12px;
  padding: 20px 16px;
  color: var(--off-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.next-3-days > div:hover {
  transform: translateY(-2px);
  background: var(--rosewood);
}

.next-3-days .date {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 4px;
}

.next-3-days .temp {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--off-white);
  margin: 8px 0;
}

.next-3-days img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
}

.empty-state {
  color: var(--plum-dark);
  padding: 24px;
  padding-bottom: 0;
  text-align: center;
  font-weight: 600;
  font-size: 3rem;
}

.empty-state img {
  width: 40%;
  height: auto;
  margin: 0 auto;
  margin-top: 50px;
}

/* ==================================== Responsive Design ==================================== */

@media (max-width: 720px) {
  .empty-state img {
    min-width: 300px;
  }

  .controls-section {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }

  .main-grid {
    padding: 10px;
    padding-top: 40px;
    margin-left: auto;
    width: 90%;
  }

  .today {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .right-side {
    border-left: none;
  }

  .next-3-days {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .next-3-days > div {
    padding: 16px;
  }

  .next-3-days .temp {
    font-size: 1.6rem;
  }

  .next-3-days img {
    width: 50px;
    height: 50px;
  }
}
