:root {
  --bg: #9ebcd6;
  --weather-bg-image-a: url('img/cielo_despejado.jpg');
  --weather-bg-image-b: url('img/cielo_despejado.jpg');
  --card: transparent;
  --muted: #5b6b7a;
  --accent: #1976d2;
  /* primary button (blue) */
  --btn-text: #ffffff;
  --secondary: rgba(245, 255, 81, .992);
  /* secondary button color */
  --accent-clear: rgba(245, 255, 81, .992);
  /* clear button (yellow) */
  --glass: rgba(2, 6, 23, 0.03);
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: var(--bg) url('img/cielo_despejado.jpg') center / cover no-repeat fixed;
  color: #16313b;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0;
  font-weight: 700;
  font-size: 1.1rem;
  position: relative;
  isolation: isolate;
}

body.drag-scrolling {
  cursor: grabbing;
  user-select: none;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body::before {
  background-image: var(--weather-bg-image-a);
  opacity: 0.9;
}

body::after {
  background-image: var(--weather-bg-image-b);
  opacity: 0;
  transition: opacity 1400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body.weather-bg-crossfade::after {
  opacity: 0.9;
}

.app {
  width: 100%;
  max-width: 1300px;
  position: relative;
  z-index: 10
}

.app-header {
  padding: 0;
  margin: 0 0 16px 0
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 80px;
  padding: 4px 0;
}

.logo-left,
.logo-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-placeholder {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #1976d2, #1565c0);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
}

.logo-pdb {
  height: 80px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.logo-desayuno {
  height: 80px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
}

.header-center {
  flex: 1;
  text-align: center;
  background: rgba(245, 255, 81, .992);
  border-radius: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.app-header h1 {
  font-size: 2.8rem;
  margin: 0;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.5px;
}

.rotating-sun {
  display: inline-block;
  animation: rotateSun 15s linear infinite;
}

@keyframes rotateSun {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: stretch;
  margin-bottom: 20px;
  align-items: flex-start;
  width: 100%;
  position: relative;
  z-index: 1200;
}

.input-group {
  background: white;
  position: relative;
  flex: 1;
  border-radius: 8px;
  min-width: 0;
  z-index: 1201;
}

.controls input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--card);
  color: inherit;
  outline: none;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6) inset;
}

/* suggestions dropdown */
.suggestions {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  width: 100%;
  min-width: 220px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.98));
  border: 1px solid rgba(14, 24, 34, 0.1);
  border-radius: 10px;
  max-height: 260px;
  overflow: auto;
  z-index: 1300;
  padding: 6px 0;
  box-shadow: 0 12px 28px rgba(6, 12, 20, 0.16)
}

.suggestions li {
  list-style: none;
  padding: 10px 12px;
  cursor: pointer;
  color: #16313b;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.suggestions li:hover,
.suggestions li.active {
  background: rgba(25, 118, 210, 0.1);
  color: #0f2b36
}

.suggestions li .small {
  font-size: 0.8rem;
  color: #4f6474
}

.suggestions.hidden {
  display: none
}

.controls button {
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: var(--btn-text);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.12);
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease
}

.controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(25, 118, 210, 0.12);
  opacity: 0.98
}

.controls button.secondary {
  background: rgba(245, 255, 81, .992);
  color: #16313b;
  border: 1px solid rgba(14, 24, 34, 0.08);
  box-shadow: 0 8px 18px rgba(6, 12, 20, 0.06);
  padding: 10px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.controls button.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(6, 12, 20, 0.10);
  opacity: 0.98
}

.content{
  display:grid;
  grid-template-columns: 1.0fr 1.0fr;
  gap:22px;
  align-items:start;
  margin-bottom:26px;
}

.card {
  background: var(--card);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(6, 12, 20, 0.06);
  border: 1px solid rgba(14, 24, 34, 0.04)
}

.card-title {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 10px
}

.map {
  width: 100%;
  height: 380px;
  overflow: hidden;
  position: relative;
  z-index: 1
}

.weather-panel {
  transition: all 350ms ease;
  opacity: 1;
}

.weather-panel.hidden {
  display: none;
}

.weather-main {
  background: var(--secondary);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: center
}

.weather-main h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
}

.weather-icon {
  width: 96px;
  height: 96px
}

.weather-desc {
  color: #16313b;
  text-transform: capitalize;
  font-size: 1.5rem;
  font-weight: 700
}

.weather-details {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  color: #16313b
}

.detail {
  background: rgba(245, 255, 81, .992);
  padding: 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.3rem;
  color: #16313b;
}

.forecast-block {
  margin-top: 14px;
}

.forecast-title {
  margin: 0 0 8px 0;
  font-size: 1.15rem;
  color: #16313b;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.forecast-card {
  background: rgba(245, 255, 81, .992);
  border-radius: 8px;
  padding: 8px;
  color: #16313b;
  text-align: center;
}

.forecast-day {
  font-size: 1.1rem;
  font-weight: 800;
}

.forecast-icon {
  width: 56px;
  height: 56px;
  margin-top: 2px;
}

.forecast-temp {
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.loader {
  position: absolute;
  right: 40px;
  top: 120px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 6px solid rgba(6, 12, 20, 0.06);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite
}

.hidden {
  display: none
}

.error-message {
  background: #fdecea;
  padding: 10px;
  border-radius: 8px;
  color: #7a241b;
  margin-bottom: 10px
}

.app-footer {
  margin-top: 26px;
  padding-bottom: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* responsive */
@media (max-width:900px) {
  body {
    padding: 12px 14px 26px
  }

  .header-content {
    gap: 28px
  }

  .content {
    margin-bottom: 18px
  }

  .content {
    grid-template-columns: 1fr;
  }

  .map {
    height: 300px
  }

  .controls {
    flex-direction: column;
  }

  .input-group {
    width: 100%;
  }

  .forecast-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* subtle appear animation */
.fade-in {
  transform: translateY(6px);
  opacity: 0
}

.fade-in.show {
  transform: none;
  opacity: 1;
  transition: all 450ms cubic-bezier(.2, .9, .2, 1)
}

/* Floating weather icons decoration */
.floating-icons {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-icons-back {
  z-index: 5;
}

.floating-icons-front {
  z-index: 25;
}

.float-icon {
  position: absolute;
  top: -10vh;
  font-size: 28px;
  opacity: 0.95;
  filter: drop-shadow(0 6px 10px rgba(20, 40, 60, 0.08));
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: 1
}

.float-icon.small {
  font-size: 20px;
  opacity: 0.85
}

.float-icon.big {
  font-size: 44px;
  opacity: 0.95
}

@keyframes fall {
  0% {
    transform: translateY(-15vh) rotate(0deg);
    opacity: 0
  }

  10% {
    opacity: 1
  }

  100% {
    transform: translateY(120vh) rotate(360deg);
    opacity: 0.9
  }
}

/* responsive tweaks for floating icons */
@media (max-width:600px) {
  body {
    padding: 10px 10px 20px
  }

  .header-content {
    gap: 14px
  }

  .logo-pdb {
    height: 64px;
    max-width: 96px
  }

  .logo-desayuno {
    height: 120px;
    max-width: 140px
  }

  .float-icon {
    font-size: 20px
  }

  .float-icon.big {
    font-size: 34px
  }
}

.logo {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 120px;
  font-weight: 900;
  letter-spacing: 4px;
  position: relative;
  display: inline-block;

  /* degradado metálico */
  background: linear-gradient(to bottom,
      #ffffff 0%,
      #e6e6e6 30%,
      #bfbfbf 55%,
      #ffffff 80%);

  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  /* relieve */
  text-shadow:
    1px 1px 0 #999,
    2px 2px 0 #888,
    3px 3px 0 #777,
    4px 4px 0 #000;
}

.logo::after {
  content: attr(data-text);
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: -1;

  color: black;
}

.footer-container{
  background: rgba(245, 255, 81, .992);
  color:#000;
  border-radius: 0;
  font-size: 15px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.a{
  color: violet;
}