:root {
  --primary-bg: #0f172a;
  --secondary-bg: rgba(30, 41, 59, 0.8);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #60a5fa;
  --error: #ef4444;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: rgba(31, 38, 135, 0.37);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  background: var(--primary-bg);
  overflow-x: hidden;
  overflow-y: auto; /* Allow vertical scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling for mobile */
  position: relative; /* Changed from fixed */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Glass Effects */
.glass {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.glass-hover:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.gradient-bg {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
}

.gradient-sphere {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.5;
}

.sphere-1 {
  background: rgba(147, 51, 234, 0.35);
  width: 50vh;
  height: 50vh;
  top: -25vh;
  left: -25vh;
  animation: float 8s ease-in-out infinite;
}

.sphere-2 {
  background: rgba(59, 130, 246, 0.35);
  width: 60vh;
  height: 60vh;
  bottom: -30vh;
  right: -30vh;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5%, 5%); }
}

/* Layout */
.app {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

header {
  padding: 0;
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.current-date {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Date Selection */
.date-selector {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.5rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  margin-right: -0.8rem;
  margin-left: -0.8rem;
}

.date-selector::-webkit-scrollbar {
  display: none;
}

.date-item {
  padding: 0.75rem 1.25rem;
  border-radius: 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-weight: 500;
  scroll-snap-align: start;
}

.date-item.active {
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: white;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

/* Current Weather */
.current-weather {
  padding: 1.5rem;
  border-radius: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.weather-icon img {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.temperature {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin: 0.5rem 0;
}

.description {
  font-size: 1.125rem;
  color: var(--text-secondary);
  text-transform: capitalize;
}

/* Hourly Forecast */
.hourly-forecast-container {
  position: relative;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}

.hourly-forecast{
  margin-right: -0.8rem;
  margin-left: -0.8rem;
}

.scroll-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scroll-indicator:hover {
  background: rgba(255, 255, 255, 0.2);
}

.scroll-left {
  left: 0.5rem;
}

.scroll-right {
  right: 0.5rem;
}

.hourly-forecast {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.hourly-forecast::-webkit-scrollbar {
  display: none;
}

.forecast-item {
  flex: 0 0 auto;
  padding: 1rem;
  border-radius: 1.25rem;
  min-width: 90px;
  text-align: center;
  scroll-snap-align: start;
}

.forecast-item .time {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.forecast-item img {
  width: 48px;
  height: 48px;
  margin: 0.5rem 0;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.forecast-item .temp {
  font-size: 1.125rem;
  font-weight: 600;
}

/* Details Panel */
.details-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
}

.detail {
  padding: 1.25rem;
  border-radius: 1.25rem;
  text-align: center;
}

.detail .label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: block;
}

.detail .value {
  font-size: 1.25rem;
  font-weight: 600;
}

/* States */
.loading .current-weather,
.loading .forecast-item,
.loading .detail {
  opacity: 0.7;
}

.error .description {
  color: var(--error);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
  .app {
    padding: 1rem;
  }
  
  .temperature {
    font-size: 2.5rem;
  }
  
  .forecast-item {
    min-width: 80px;
  }
  
  .detail {
    padding: 1rem;
  }
}

.shape1 {
	height: 150px;
	width: 150px;
	position: absolute;
	background: -o-linear-gradient(315deg, #ff5b84, #eb3461);
	background: linear-gradient(135deg, #6e9ffa, #9b8efa);
	border-radius: 50%;
	top: 150px;
	right: -50px;
	z-index: -1;
}

.shape2 {
	height: 150px;
	width: 150px;
	position: absolute;
	background: -o-linear-gradient(315deg, #426cf8, #3ebdf0);
	background: linear-gradient(135deg, #9f8cf9, #7674fa);
	border-radius: 50%;
	bottom: 100px;
	left: -50px;
	z-index: -1;
}

.gradient-bg, .gradient-sphere, .shape1, .shape2 {
  overflow: hidden;
  max-width: 100vw;
  max-height: 100vh;
}

.app {
  max-width: 100%; /* Ensure it doesn't overflow horizontally */
  height: auto; /* Allow natural height growth */
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

html, body {
  overflow-x: hidden;
  overflow-y: auto; /* Ensure vertical scrolling is enabled */
  height: 100%;
  width: 100%;
}

body {
  position: relative;
  z-index: -5;
}

#install-button {
	background: linear-gradient(135deg, var(--accent), #a78bfa);
    color: white;
	width: 10rem;
	border-radius: 1.25rem;
	color: white;
}