:root {
  --top-bar: #000000; 
  --text-white: #ffffff;
  --icon-color: #FFD700; /* Amarillo Oro TBC */
  --modal-bg: rgba(0, 0, 0, 0.6);
  --panel-bg: #ffffff;
  
  /* WEATHER COLORS (Default: Cloudy/Neutral) */
  --sky-color-1: #6a8caf;
  --sky-color-2: #85a8c4;
  --sky-color-3: #adb7c0;
}

body.weather-sunny {
  --sky-color-1: #345c99;
  --sky-color-2: #5a8ac7;
  --sky-color-3: #93c3dc;
}

body.weather-rainy {
  --sky-color-1: #4a5d73;
  --sky-color-2: #65798e;
  --sky-color-3: #8a96a3;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden; 
  font-family: "Roboto", system-ui, sans-serif;
  background: var(--sky-color-1);
  color: var(--text-white);
  transition: background 1s ease;
}

.sky-top { stop-color: var(--sky-color-1); transition: stop-color 1s ease; }
.sky-mid { stop-color: var(--sky-color-2); transition: stop-color 1s ease; }
.sky-bottom { stop-color: var(--sky-color-3); transition: stop-color 1s ease; }


.app-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* TOP ACTION BAR */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 56px;
  background: var(--top-bar);
  z-index: 10;
  color: var(--icon-color);
}

.logo-btn {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0;
  margin: 0;
}



.icon-btn {
  background: none;
  border: none;
  color: inherit;
  width: 38px;
  height: 38px;
  padding: 6px;
  cursor: pointer;
}

.icon-btn svg { width: 100%; height: 100%; }

/* WEATHER ANIMATIONS */
@keyframes cloudDrift {
  0% { transform: translateX(0); }
  50% { transform: translateX(80px); }
  100% { transform: translateX(0); }
}

@keyframes rainDrop {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -120; }
}

@keyframes rainDropFast {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -90; }
}

.falling-rain {
  animation: rainDrop 0.8s linear infinite;
}

.falling-rain.rain-fast {
  animation: rainDropFast 0.5s linear infinite;
  opacity: 0.6;
}

/* VECTOR SCENE */
.vector-scene {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.vector-scene svg {
  width: 100%;
  height: 100%;
  display: block;
}



/* HUD OVERLAY */
.hud {
  position: absolute;
  top: 90px;
  width: 100%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.main-height {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.main-height .trend {
  font-size: 80px;
  font-weight: 500;
  margin-right: 12px;
  transform: translateY(-4px);
}

.main-height .value {
  font-size: 130px;
  font-weight: 400;
  letter-spacing: -2px;
}

.main-height .unit {
  font-size: 28px;
  font-weight: 500;
  margin-left: 12px;
  align-self: flex-end;
  margin-bottom: 24px;
}

.weather {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  font-size: 24px;
  font-weight: 400;
  margin-top: 10px;
}

.w-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.w-item svg {
  width: 20px;
  height: 20px;
}

/* BOTTOM TEXT */
.bottom-info {
  position: absolute;
  bottom: 20px;
  width: 100%;
  z-index: 5;
  text-align: center;
  color: var(--text-white);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4); 
}

.bottom-title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 2px;
}

.bottom-sub {
  font-size: 13px;
  opacity: 0.85;
}

/* WATER TWEEN CSS */
/* Handled by GSAP now */
/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--panel-bg);
  color: #333;
  width: 320px;
  border-radius: 16px;
  padding: 32px 24px;
  position: relative;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: #eee;
  border-radius: 50%;
  font-weight: bold;
  color: #666;
  cursor: pointer;
}

.modal-content h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.qr-box {
  border: 1px dashed #ccc;
  padding: 12px;
  display: inline-block;
  border-radius: 8px;
}

.qr-box img {
  width: 200px;
  height: 200px;
  display: block;
}

/* Bottom Sheet Modal Variation */
.modal-overlay {
  align-items: center; /* Default back to center */
}

.modal-overlay.bottom-sheet-overlay {
  align-items: flex-end; 
}

.modal-sheet {
  box-sizing: border-box;
  background: #1e293b; /* Dark navy premium tone */
  color: #f8fafc;
  width: 100%;
  max-width: 480px;
  border-radius: 28px 28px 0 0;
  padding: 45px 30px 40px 30px;
  position: relative;
  text-align: center;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-overlay.active .modal-sheet {
  transform: translateY(0);
}

/* DESKTOP / NOTEBOOK OPTIMIZATION */
@media (min-width: 600px) {
  body {
    background: #0f172a !important; /* Dark neutral background for desktop */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto; /* allow some scroll if height is tight */
  }
  
  .app-container {
    max-width: 450px;
    height: 92vh;
    max-height: 900px;
    margin: auto;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 100px rgba(0,0,0,0.6);
    border: 8px solid #1e293b; /* Premium border "bezel" */
  }
}

/* FLOATING INFO BUTTON */
.fab-info {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: transform 0.2s, background 0.2s;
}

.fab-info:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.3);
}

.fab-info svg {
  width: 26px;
  height: 26px;
}

/* PULL TO REFRESH STYLES */
.ptr-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1; /* Detrás de la app */
  pointer-events: none;
  opacity: 0;
}

.ptr-icon {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
}

.ptr-loading .ptr-icon {
  animation: ptr-spin 0.8s linear infinite;
}

@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.app-container {
  position: relative;
  z-index: 10; /* Encima del indicador */
  background: var(--sky-color-1);
  will-change: transform;
}

/* JUNCO ANIMATION */
.junco {
  transform-origin: bottom center;
  animation: junco-sway 4.5s ease-in-out infinite;
}

@keyframes junco-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg) skewX(1deg); }
}
