@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --font-family: "Poppins", sans-serif;
  --bg-default: #fbfbfb;
  --bg-paper: #fbfbfb;
  --bg-paper-alternate: #e0e0e0;
  --text-primary: #333;
  --text-secondary: #424040;
  --text-disabled: #999;
  --black: #000;
  --white: #fff;
  --primary: #007bff;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;

  --gradient-primary: linear-gradient(to right, #4facfe, #007bff);
  --gradient-success: linear-gradient(to right, #28a745, #28a745);
  --gradient-danger: linear-gradient(to right, #dc3545, #dc3545);
  --gradient-warning: linear-gradient(to right, #ffc107, #ffc107);
  --gradient-info: linear-gradient(to right, #17a2b8, #17a2b8);

  --box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 0 0.75rem rgba(0, 0, 0, 0.2);
  --box-shadow-success: 0 0 0.75rem rgba(40, 167, 69, 0.5);
  --box-shadow-danger: 0 0 0.75rem rgba(220, 53, 69, 0.5);
  --box-shadow-warning: 0 0 0.75rem rgba(255, 193, 7, 0.5);
  --box-shadow-info: 0 0 0.75rem rgba(23, 162, 184, 0.5);

  --transition: all 0.2s ease-in-out;
}

:root[data-theme="dark"] {
  --bg-default: #191919;
  --bg-paper: #212121;
  --bg-paper-alternate: #303030;
  --text-primary: #f5f5f5;
  --text-secondary: #ccc;
  --text-disabled: #666;

  --gradient-primary: linear-gradient(to right, #053055, #031426);
  --gradient-success: linear-gradient(to right, #155724, #155724);
  --gradient-danger: linear-gradient(to right, #721c24, #721c24);
  --gradient-warning: linear-gradient(to right, #856404, #856404);
  --gradient-info: linear-gradient(to right, #117a8b, #117a8b);

  --box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.5);
}

* {
  font-family: var(--font-family);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-default);
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-y: scroll;
  position: relative;
  flex-direction: column;
  min-height: 100vh;
}

h1 {
  font-weight: 500;
  color: var(--text-primary);
}
p {
  font-weight: 300;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

[data-toggle="theme"] {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--bg-default);
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--text-primary);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.5rem;
  box-shadow: var(--box-shadow);
  text-decoration: none;
}

[data-toggle="theme"]:hover {
  transform: scale(1.01);
  box-shadow: var(--box-shadow-hover);
  text-decoration: none;
}

[data-theme="dark"] [data-toggle="theme"] {
  color: var(--warning);
}

[data-theme="dark"] [data-toggle="theme"] .light,
[data-theme="light"] [data-toggle="theme"] .dark {
  display: none;
}

[data-theme="dark"] [data-toggle="theme"] .dark,
[data-theme="light"] [data-toggle="theme"] .light {
  display: block;
}

.wrap {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  height: -webkit-fill-available;
  color: var(--text-secondary);
  font-size: small;
  flex-grow: 1;
}

@media screen and (min-width: 900px) {
  .wrap {
    width: 70vw;
  }
}

@media screen and (min-width: 1300px) {
  .wrap {
    width: 50vw;
  }
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  gap: 0.5rem;
  border-radius: 1rem;
  padding: 1rem;
  color: var(--text-primary);
  width: 100%;
}

form {
  display: flex;
  gap: 1rem;
  width: 100%;
}

input {
  all: unset;
  width: 100%;
  padding: 0.75rem;
  box-sizing: border-box;
  border-radius: 4rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-disabled);
  font-size: 0.75rem;
  text-align: center;
}

button {
  padding: 0.75rem 1rem;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 4rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  font-size: 0.8rem;
  font-weight: 600;
}

button:hover {
  background: #008ecc;
}

.text-caption{
  font-size: small;
  color: var(--text-secondary);
  font-weight: 300;
}

.symbol{
  font-size: 1.5rem;
  color: var(--info);
}

.container{
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.row{
  display: flex;
  gap: 1rem;
}

@media screen and (max-width: 700px)  {
  .row{
    flex-direction: column;
  }
}

.col{
  flex-grow: 1;
}

.weather{
  flex-grow: 1;
  display: flex;
  justify-content: start;
  align-items: start;
  gap: 0.5rem;
  background: rgba(7, 176, 255, 0.164);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  border-radius: 1rem;
}
@media screen and (max-width: 700px)  {
 .weather{
    flex-direction: column-reverse;
  }
}

.weather .left{
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  gap: 1rem;

}

.weather img{
  width: 160px;
  height: 160px;
}

.weather .temperature{
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.weather .temperature h2{
  display: flex;
  align-items: start;
  gap: 0.5rem;
}

.weather .temperature h2 span{
  margin-top: 1rem;
}

.weather .cloud .percent{
  color: var(--info);
}

.weather .min-max{
  display: flex;
  gap: 1rem;
}

.weather .min-max .min,.min-max .max{
  display: flex;
  gap: 0.5rem;
}

.location,.air-quality,.time{
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: var(--box-shadow);
}

.location .city{
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0.5rem 0;
}

.location .item,.air-quality .item,.time .item{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.error {
  background-color: var(--bg-paper-alternate);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 3rem 1rem;
  border-radius: 1rem;
  box-shadow: var(--box-shadow);
  font-size: larger;
  font-weight: 300;
  text-transform: capitalize;
  display: none;
}

.error.active {
  display: flex;
}

a{
  text-decoration: none;
  color: var(--success);
}

a:hover{
  text-decoration: underline;
}

footer.credit{
  all: unset;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  margin: 0 auto;
  width: fit-content;
  background-color: transparent;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
}
