apps/weather/src/styles.css
/* CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* CSS Custom Properties */
:root {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-primary: #0066cc;
  --color-primary-hover: #0052a3;
  --color-success: #28a745;
  --color-error: #dc3545;
  --color-border: #dee2e6;
  --color-shadow: rgba(0, 0, 0, 0.1);
  
  --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  
  --border-radius: 8px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  
  --transition: all 0.2s ease;
}

/* Dark mode */
[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #121212;
    --color-surface: #1e1e1e;
    --color-text: #e0e0e0;
    --color-text-muted: #a0a0a0;
    --color-primary: #4da6ff;
    --color-primary-hover: #66b3ff;
    --color-success: #4caf50;
    --color-error: #f44336;
    --color-border: #333333;
    --color-shadow: rgba(0, 0, 0, 0.3);
  }
}

/* Base styles */
html {
  font-family: var(--font-system);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: var(--transition);
}

body {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--spacing-sm);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-border);
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
}

#theme-toggle {
  background: none;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-xs);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

#theme-toggle:hover {
  background-color: var(--color-surface);
  border-color: var(--color-primary);
}

/* Main content */
main {
  flex: 1;
}

/* Search section */
.search {
  margin-bottom: var(--spacing-lg);
}

.search label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 600;
  color: var(--color-text);
}

.input-group {
  display: flex;
  gap: var(--spacing-xs);
}

input[type="text"] {
  flex: 1;
  padding: var(--spacing-sm);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: var(--transition);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

button {
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

button:hover {
  background-color: var(--color-primary-hover);
}

button:active {
  transform: translateY(1px);
}

/* Weather display */
.weather-card {
  background-color: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 6px var(--color-shadow);
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.weather-header h2 {
  font-size: 1.5rem;
  color: var(--color-text);
}

.weather-icon {
  font-size: 3rem;
}

.weather-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  align-items: center;
}

.temperature {
  text-align: center;
}

#temp-current {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
}

.temp-range {
  margin-top: var(--spacing-xs);
  color: var(--color-text-muted);
  font-size: 1rem;
}

.weather-details p {
  margin-bottom: var(--spacing-xs);
}

.weather-details p:first-child {
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: capitalize;
}

/* Weather stats */
.weather-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.stat {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-sm);
  background-color: var(--color-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.stat-value {
  font-weight: 600;
  color: var(--color-text);
}

/* Sun times */
.weather-sun {
  display: flex;
  justify-content: space-around;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.sun-time {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* Error display */
.error-card {
  background-color: var(--color-surface);
  border: 2px solid var(--color-error);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  text-align: center;
}

.error-card h3 {
  color: var(--color-error);
  margin-bottom: var(--spacing-sm);
}

.error-card p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-muted);
}

#retry-button {
  background-color: var(--color-error);
}

#retry-button:hover {
  background-color: #c82333;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--spacing-md);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Footer */
footer {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--color-primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 600px) {
  body {
    padding: var(--spacing-xs);
  }
  
  .weather-main {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .weather-stats {
    grid-template-columns: 1fr;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  #temp-current {
    font-size: 2.5rem;
  }
}