/* =========================
   GLOBAL RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   BODY
========================= */
body {
  background: #000;
  min-height: 100dvh;
  font-family: Arial, sans-serif;
  color: #fff;
  position: relative;
  overflow-x: hidden;
}

/* =========================
   VIDEOS (INTRO + BACKGROUND)
========================= */
#background-video,
#intro-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

#intro-container {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* =========================
   LOADING SCREEN
========================= */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: 0.4s;
}

#loading-screen.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================
   VIEW TOGGLE BUTTONS
========================= */
.view-toggle {
  position: fixed;
  top: env(safe-area-inset-top, 12px);
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 15;
}

.toggle-btn {
  font-size: 20px;
  padding: 8px 12px;
  border-radius: 50px;
  border: none;
  background: rgba(255,255,255,0.25);
  color: #fff;
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.toggle-btn.active {
  background: rgba(255,255,255,0.45);
}

.toggle-btn:active {
  transform: scale(0.95);
}

/* =========================
   WEATHER BOX
========================= */
.weather-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 420px;
  min-height: 420px;
  max-height: 80dvh;
  padding: 15px;
  background: rgba(255,255,255,0.2);
  border-radius: 24px;
  backdrop-filter: blur(8px);
  overflow-y: auto;
  z-index: 10;
  visibility: hidden;
}

.weather-info h2,
.weather-info p,
.temperature,
.conditions,
.weather-details,
.weather-detail-item,
.sun-times {
  color: #000;
}

/* =========================
   WEATHER DETAILS GRID
========================= */
.weather-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.weather-detail-item {
  background: rgba(255,255,255,0.5);
  padding: 10px;
  border-radius: 12px;
  text-align: center;
}

/* =========================
   MAP CONTAINER
========================= */
#map-container {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(120%);
  width: 95%;
  max-width: 850px;
  height: 50dvh;
  border-radius: 20px;
  overflow: hidden;
  z-index: 10;
  transition: transform 0.6s ease;
}

#map-container.slide-in {
  transform: translateX(-50%);
}

#map-container.slide-out {
  transform: translateX(120%);
}

#map {
  width: 100%;
  height: 100%;
}

/* =========================
   INPUT CONTAINER
========================= */
.input-container {
  position: fixed;
  left: 50%;
  bottom: env(safe-area-inset-bottom, 12px);
  transform: translateX(-50%);
  width: 95%;
  max-width: 520px;
  display: flex;
  gap: 8px;
  z-index: 20;
}

.input-form {
  flex: 1;
  height: 48px;
  background: rgba(255,255,255,0.6);
  border-radius: 30px;
  display: flex;
  align-items: center;
}

.input-bar {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 15px;
  font-size: 16px;
  outline: none;
}

.searchbtn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.6);
  font-size: 22px;
  cursor: pointer;
}

.searchbtn:active {
  transform: scale(0.9);
}

/* =========================
   COPYRIGHT
========================= */
.copyright {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 4px);
  width: 100%;
  text-align: center;
  font-size: 10px;
  z-index: 5;
}

/* =========================
   MOBILE (≤768px)
========================= */
@media (max-width: 768px) {
  .weather-box {
    width: 95%;
    max-height: 75dvh;
  }

  #map-container {
    height: 45dvh;
  }

  .toggle-btn {
    font-size: 18px;
  }
}

/* =========================
   TABLETS (768px–1024px)
========================= */
@media (min-width: 768px) and (max-width: 1024px) {
  .weather-box {
    max-width: 380px;
  }

  #map-container {
    height: 55dvh;
  }
}

/* =========================
   DESKTOP (≥1024px)
========================= */
@media (min-width: 1024px) {
  .weather-box {
    max-width: 460px;
  }

  #map-container {
    height: 60vh;
  }
}

/* =========================
   LANDSCAPE SMALL HEIGHT
========================= */
@media (orientation: landscape) and (max-height: 500px) {
  .weather-box {
    top: 55%;
    max-height: 90dvh;
  }

  #map-container {
    height: 65dvh;
  }
}
  .weather-box {
    top: 40%;
  }
  
  #map-container {
    width: 100%;
    height: 40vh;
  }
  
  .view-toggle {
    top: env(safe-area-inset-top, 10px);
    right: env(safe-area-inset-right, 10px);
  }
  
  .input-container {
    bottom: env(safe-area-inset-bottom, 10px);
    padding: 10px;
  } 