/* Sun & Clouds Light Theme CSS */
:root {
  --bg-primary: #e0f2fe; /* Light sky blue */
  --bg-secondary: rgba(255, 255, 255, 0.65); /* Glassmorphism light */
  --bg-tertiary: rgba(255, 255, 255, 0.9);
  --text-primary: #0f172a; /* Dark slate */
  --text-secondary: #475569;
  --accent-color: #f59e0b; /* Sunny yellow/orange */
  --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px 0 rgba(14, 165, 233, 0.12); /* Soft blue shadow */
  --font-main: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, #38bdf8 0%, #e0f2fe 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ☀️ The Sun */
body::before {
  content: '';
  position: fixed;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #fef08a 10%, #facc15 30%, rgba(250, 204, 21, 0) 60%);
  border-radius: 50%;
  filter: blur(50px);
  z-index: -2;
  animation: pulseSun 6s infinite alternate ease-in-out;
}

/* ☁️ Cloud 1 (Fast, Foreground) */
body::after {
  content: '';
  position: fixed;
  top: 15%;
  left: -250px;
  width: 180px;
  height: 50px;
  background: white;
  border-radius: 50px;
  box-shadow: 
    30px -25px 0 10px white,
    80px -10px 0 5px white;
  opacity: 0.9;
  z-index: -1;
  animation: floatCloud 35s linear infinite;
}

/* ☁️ Cloud 2 (Slow, Background) */
#root::before {
  content: '';
  position: fixed;
  top: 45%;
  left: -200px;
  width: 120px;
  height: 35px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  box-shadow: 
    20px -15px 0 5px rgba(255, 255, 255, 0.7),
    50px -5px 0 0 rgba(255, 255, 255, 0.7);
  z-index: -2;
  animation: floatCloud 50s linear infinite 12s;
}

/* ☁️ Cloud 3 (Top Left) */
#root::after {
  content: '';
  position: fixed;
  top: 5%;
  left: -200px;
  width: 150px;
  height: 40px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  box-shadow: 
    25px -20px 0 8px rgba(255, 255, 255, 0.5),
    60px -8px 0 2px rgba(255, 255, 255, 0.5);
  z-index: -3;
  animation: floatCloud 65s linear infinite 5s;
}

#root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
  animation: fadeIn 0.8s ease-out forwards;
  z-index: 10;
  position: relative;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-color);
}

.title-section h1 {
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  margin: 0;
  display: flex;
  align-items: center;
}

.brand-part-1 {
  color: var(--text-primary);
}

.brand-part-2 {
  color: var(--accent-color);
}

.title-section p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 500;
}

.glass-panel {
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 45px 0 rgba(14, 165, 233, 0.25);
}

.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 0.6rem 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: white;
  color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.15);
}

.filter-btn.active {
  background: var(--accent-gradient);
  color: white;
  border: none;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

/* Specific panels */
.panel-ai-summary {
  grid-column: span 12;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.5) 100%);
}

.panel-ai-summary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: var(--accent-gradient);
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ai-icon {
  color: #f59e0b;
  animation: pulseSun 2s infinite alternate;
}

.ai-content {
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1.7;
  font-weight: 500;
}

.ai-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1rem;
  background-color: var(--accent-color);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
  border-radius: 4px;
}

.panel-stats {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
}

.stat-title {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: #0284c7;
}

.stat-trend {
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--error); }
.trend-neutral { color: var(--text-secondary); }

.panel-chart {
  grid-column: span 12;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.chart-header {
  margin-bottom: 1rem;
}

.chart-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: #0f172a;
}

.css-chart-container {
  flex-grow: 1;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding-top: 2rem;
  padding-bottom: 1rem;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

.css-chart-container::-webkit-scrollbar {
  height: 8px;
}

.css-chart-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.css-chart-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
}

.css-chart-bar-wrapper {
  flex: 1;
  min-width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.css-chart-bar {
  width: 100%;
  background: var(--accent-gradient);
  border-radius: 8px 8px 0 0;
  transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  opacity: 0.85;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}

.css-chart-bar:hover {
  opacity: 1;
  transform: scaleY(1.02);
  transform-origin: bottom;
}

.css-chart-label {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.css-chart-tooltip {
  position: absolute;
  top: -35px;
  background: var(--text-primary);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  transform: translateY(5px);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  z-index: 10;
}

.css-chart-bar-wrapper:hover .css-chart-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Skeleton Loading Light Theme */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.4) 25%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0.4) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-text { height: 1.5rem; margin-bottom: 0.5rem; width: 100%; }
.skeleton-text.short { width: 50%; }
.skeleton-title { height: 2.5rem; width: 60%; margin-bottom: 1rem; }
.skeleton-chart { height: 200px; width: 100%; border-radius: 12px; }

/* Error Boundary */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.error-icon {
  font-size: 3.5rem;
  color: var(--error);
  margin-bottom: 1rem;
}

.retry-btn {
  margin-top: 1.5rem;
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.25);
  transition: all 0.2s;
}

.retry-btn:hover { 
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(110vw); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulseSun {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.05); filter: brightness(1.1); box-shadow: 0 0 100px 50px rgba(250, 204, 21, 0.3); }
}

@keyframes blink {
  50% { opacity: 0; }
}

/* --- Day Detail Overlay --- */
.day-overlay-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

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

.day-overlay-content {
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  gap: 2rem;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.day-overlay-content.active {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: white;
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  z-index: 101;
  color: var(--error);
}

.close-btn:hover {
  transform: scale(1.1);
}

.day-left-pane {
  flex: 0 0 33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  padding: 2rem;
}

.big-bar-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.big-bar {
  width: 140px;
  background: var(--accent-gradient);
  border-radius: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.4);
  animation: popIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: center;
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.big-bar-value {
  color: white;
  font-size: 2.5rem;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.big-date {
  margin-top: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: capitalize;
  text-align: center;
}

.day-right-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 2rem;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.detail-stat {
  background: rgba(255,255,255,0.5);
  padding: 1rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.detail-stat span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.detail-stat strong {
  font-size: 1.75rem;
  color: #0284c7;
}

.hourly-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 15px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hourly-list::-webkit-scrollbar {
  width: 6px;
}
.hourly-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

.hourly-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.4);
  border-radius: 10px;
  transition: background 0.2s;
}

.hourly-item:hover {
  background: rgba(255,255,255,0.8);
}

.hourly-time {
  font-weight: 700;
  color: var(--text-secondary);
  width: 50px;
}

.hourly-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  overflow: hidden;
}

.hourly-temp-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 10px;
  transition: width 1s ease-out;
}

.hourly-temp {
  font-weight: 700;
  width: 50px;
  text-align: right;
}

.hourly-precip {
  width: 70px;
  text-align: right;
  font-weight: 600;
  color: var(--text-secondary);
}

.hourly-precip.has-rain {
  color: #0284c7;
}

/* Responsive */
@media (max-width: 1024px) {
  .panel-stats { grid-column: span 6; }
  .panel-chart { grid-column: span 12; }
  
  .day-overlay-content {
    flex-direction: column;
    height: 90vh;
  }
  .day-left-pane { flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: space-between; }
  .big-bar-container { display: none; }
  .big-date { margin-top: 0; }
}

@media (max-width: 768px) {
  .dashboard-container { padding: 1rem 0.75rem; }
  .glass-panel { padding: 1.25rem; }
  .panel-stats { grid-column: span 12; }
  
  .title-section h1 { font-size: 2.2rem; }
  .brand-icon { width: 32px; height: 32px; }
  header { margin-bottom: 1.5rem; }

  .day-overlay-content {
    width: 95%;
    height: 95vh;
    padding: 1rem;
    gap: 1rem;
  }
  .day-left-pane { padding: 1rem; }
  .day-right-pane { padding: 0; }
  
  .detail-stats-grid { 
    grid-template-columns: 1fr; 
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .dashboard-container { padding: 0.5rem; }
  .glass-panel { padding: 1rem; }
  .title-section h1 { font-size: 1.8rem; }
  .brand-icon { width: 28px; height: 28px; }
  .stat-card-value { font-size: 1.5rem; }
  .css-chart-container { gap: 8px; }
  .css-chart-bar-wrapper { min-width: 32px; }
}
