/* ========================================
   RESPONSIVE WEATHER APP - MOBILE FIRST
   ======================================== */

/* CSS Custom Properties for theming and spacing */
:root {
  /* Color Palette */
  --primary-light: #667eea;
  --primary: #5568d3;
  --primary-dark: #3d5a80;
  --accent: #64b5f6;
  --accent-warm: #ffb74d;
  --success: #26de81;
  --danger: #ff6348;
  --bg-dark: #0f1c35;
  --bg-light: #1a2d47;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-light: rgba(255, 255, 255, 0.18);
  --white: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.85);
  --white-muted: rgba(255, 255, 255, 0.65);
  --line: rgba(255, 255, 255, 0.1);

  /* Typography - Mobile first (base font-size: 16px) */
  --font-xs: 0.75rem;      /* 12px */
  --font-sm: 0.875rem;     /* 14px */
  --font-base: 1rem;       /* 16px */
  --font-lg: 1.125rem;     /* 18px */
  --font-xl: 1.25rem;      /* 20px */
  --font-2xl: 1.5rem;      /* 24px */
  --font-3xl: 1.875rem;    /* 30px */
  --font-4xl: 2.25rem;     /* 36px */

  /* Spacing - Mobile first */
  --spacing-xs: 0.5rem;    /* 8px */
  --spacing-sm: 1rem;      /* 16px */
  --spacing-md: 1.5rem;    /* 24px */
  --spacing-lg: 2rem;      /* 32px */
  --spacing-xl: 2.5rem;    /* 40px */

  /* Touch targets - Minimum 44px for accessibility */
  --touch-target: 2.75rem; /* 44px */

  /* Border radius */
  --radius-sm: 0.875rem;   /* 14px */
  --radius-md: 1rem;       /* 16px */
  --radius-lg: 1.75rem;    /* 28px */

  /* Transitions */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;
  --transition-smooth: 0.5s;
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  /* Enable smooth scrolling on iOS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh; /* Use dynamic viewport height for mobile browsers */
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #0f1c35 0%, #1a2d47 50%, #2a4d6f 100%);
  background-attachment: fixed; /* Prevent scroll lag on mobile */
  color: var(--white);
  position: relative;
  overflow-x: hidden;
}

/* Background decorative elements - optimized for performance */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float 6s ease-in-out infinite;
  /* Reduce animation on low-power devices */
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

body::after {
  content: "";
  position: fixed;
  bottom: -20%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(100, 181, 246, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: float 8s ease-in-out infinite reverse;
  /* Reduce animation on low-power devices */
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

/* Animation for entry effect */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation for fade-in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Animation for bounce effect */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Animation for shine effect */
@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Animation for text reveal */
@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animation for bouncing check */
@keyframes bounceCheck {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

/* Animation for spinning loader */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Animation for shake effect */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

/* Animation for pulsing effect */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Animation for card glow */
@keyframes cardGlow {
  from {
    opacity: 0;
    transform: scale(0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 42px 64px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  }
}

/* Animation for slide-in */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   MAIN LAYOUT - MOBILE FIRST
   ======================================== */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: var(--spacing-sm);
  position: relative;
  z-index: 1;
  gap: var(--spacing-md);
  /* Safe area support for notched devices */
  padding-top: max(var(--spacing-sm), env(safe-area-inset-top));
  padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
  padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
  padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
}

.weather-panel {
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.6s ease-out;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

/* ========================================
   HEADER SECTION
   ======================================== */

.app-header {
  text-align: center;
  margin-bottom: var(--spacing-md);
  opacity: 1;
  transition: opacity var(--transition-smooth) cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.app-header.hidden-header {
  opacity: 0;
  pointer-events: none;
}

.app-title {
  font-size: var(--font-2xl);
  font-weight: 700;
  margin: 0 0 var(--spacing-xs);
  background: linear-gradient(135deg, var(--white) 0%, var(--white-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  word-break: break-word;
}

.app-subtitle {
  font-size: var(--font-sm);
  color: var(--white-muted);
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.3px;
  opacity: 0.9;
  word-break: break-word;
}

/* ========================================
   SEARCH FORM
   ======================================== */

.search-form {
  margin-bottom: var(--spacing-md);
  width: 100%;
}

.search-form input {
  width: 100%;
  /* Touch-friendly: minimum 44px height */
  padding: calc((var(--touch-target) - var(--font-base) - 2px) / 2) var(--spacing-sm);
  border: 2px solid transparent;
  outline: none;
  border-radius: var(--radius-md);
  font-size: var(--font-base);
  font-family: "Poppins", sans-serif;
  background: var(--surface-light);
  color: var(--white);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  letter-spacing: 0.3px;
  /* Improve input appearance on iOS */
  -webkit-appearance: none;
  appearance: none;
  min-height: var(--touch-target);
}

.search-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.search-form input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(100, 181, 246, 0.2), 0 0 0 1px var(--accent);
  transform: translateY(-2px);
}

.search-form input:active {
  transform: translateY(0);
}

/* Tablet and up */
@media (min-width: 768px) {
  .search-form input {
    font-size: var(--font-lg);
  }
}

/* ========================================
   WEATHER CARD - MOBILE FIRST
   ======================================== */

.weather-card {
  /* Mobile-first: flexible height */
  min-height: auto;
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-sm);
  background: linear-gradient(
    135deg,
    rgba(93, 104, 211, 0.15) 0%,
    rgba(100, 181, 246, 0.08) 50%,
    rgba(38, 222, 129, 0.05) 100%
  );
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 42px 64px rgba(0, 0, 0, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--spacing-md);
  transition: all var(--transition-smooth) cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardGlow 0.8s ease-out;
  will-change: transform;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.weather-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 48px 72px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

.weather-card__top {
  text-align: center;
  margin-bottom: 0;
}

.weather-date {
  margin: 0;
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--white-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.8;
}

.weather-city {
  margin: var(--spacing-xs) 0 0;
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--white) 0%, var(--white-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-break: break-word;
  overflow-wrap: break-word;
}

.weather-card__hero {
  text-align: center;
  margin: 0;
  animation: fadeIn 0.6s ease-out 0.2s both;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.weather-main-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: var(--spacing-xs);
  display: block;
  animation: bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px rgba(100, 181, 246, 0.3));
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.weather-description {
  margin: 0 0 var(--spacing-xs);
  color: var(--white-soft);
  font-size: var(--font-base);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.weather-temp {
  font-size: 3.2rem;
  font-weight: 300;
  line-height: 1;
  background: linear-gradient(180deg, var(--accent-warm) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.weather-temp span:first-child {
  font-weight: 300;
  font-size: 1.15em;
}

.weather-extra {
  margin-top: var(--spacing-md);
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: var(--spacing-sm) 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
}

.weather-extra__row {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) 0;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--white-soft);
  transition: all var(--transition-normal) ease;
}

.weather-extra__row:active {
  color: var(--accent);
  transform: translateX(2px);
}

.weather-extra__row:hover {
  color: var(--accent);
  transform: translateX(4px);
}

.weather-extra__row span:first-child {
  opacity: 0.8;
  font-weight: 400;
  flex: 1;
}

.weather-extra__row span:last-child {
  font-weight: 600;
  color: var(--white);
}

/* Tablet and up */
@media (min-width: 768px) {
  .weather-panel {
    max-width: 440px;
  }

  .weather-card {
    padding: var(--spacing-lg) var(--spacing-md);
    min-height: auto;
  }

  .weather-title {
    font-size: var(--font-3xl);
  }

  .weather-main-icon {
    font-size: 5.5rem;
  }

  .weather-temp {
    font-size: 4.2rem;
  }
}

/* Desktop and up */
@media (min-width: 1024px) {
  .weather-panel {
    max-width: 480px;
  }

  .weather-card {
    padding: var(--spacing-lg) var(--spacing-md);
  }
}

/* ========================================
   LOADING & FEEDBACK STATES
   ======================================== */

.hidden {
  display: none !important;
}

.loading {
  background: linear-gradient(135deg, rgba(100, 181, 246, 0.15) 0%, rgba(100, 181, 246, 0.08) 100%);
  color: var(--accent);
  border: 2px solid rgba(100, 181, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  box-shadow: 0 12px 36px rgba(100, 181, 246, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  margin-bottom: var(--spacing-sm);
  border-radius: var(--radius-md);
  /* Touch-friendly minimum height */
  min-height: var(--touch-target);
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-sm);
  font-weight: 500;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.3px;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.loading::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(100, 181, 246, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
    opacity: 0.6;
  }
}

/* ========================================
   FEEDBACK MESSAGES - ERROR, SUCCESS, WARNING
   ======================================== */

.feedback {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.08) 100%);
  color: #fca5a5;
  border: 2px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 12px 36px rgba(239, 68, 68, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1), shake 0.5s ease-out;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  font-weight: 500;
  letter-spacing: 0.3px;
  border-bottom: 3px solid transparent;
  min-height: var(--touch-target);
  /* Touch-friendly minimum height */
  border-image: linear-gradient(90deg, transparent 0%, rgba(239, 68, 68, 0.8) 50%, transparent 100%) 1;
  @media (prefers-reduced-motion: reduce) {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

.feedback::before {
  content: "⚠";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  font-size: 1.3rem;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.feedback::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  animation: shine 2s ease-in-out infinite;
  pointer-events: none;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.feedback-message {
  flex: 1;
  font-weight: 500;
  letter-spacing: 0.3px;
  animation: textReveal 0.5s ease-out 0.1s both;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.feedback.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.08) 100%);
  color: #86efac;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 36px rgba(16, 185, 129, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-image: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.8) 50%, transparent 100%) 1;
}

.feedback.success::before {
  content: "✓";
  animation: bounceCheck 0.6s ease-out;
  @media (prefers-reduced-motion: reduce) {
    animation: none;
  }
}

.feedback.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.08) 100%);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 12px 36px rgba(245, 158, 11, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  border-image: linear-gradient(90deg, transparent 0%, rgba(245, 158, 11, 0.8) 50%, transparent 100%) 1;
}

.feedback.warning::before {
  content: "!";
  font-weight: 700;
  font-size: 1.5rem;
}

/* ========================================
   FOOTER
   ======================================== */

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.35);
  background: transparent;
  z-index: 10;
  pointer-events: none;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: opacity var(--transition-smooth) cubic-bezier(0.4, 0, 0.2, 1);
  /* Safe area support for notched devices */
  padding-bottom: max(var(--spacing-xs), env(safe-area-inset-bottom));
  padding-left: max(var(--spacing-sm), env(safe-area-inset-left));
  padding-right: max(var(--spacing-sm), env(safe-area-inset-right));
}

.app-footer.visible {
  opacity: 1;
  pointer-events: auto;
}

.app-footer p {
  margin: 0;
  font-weight: 400;
  word-break: break-word;
}

.app-footer a {
  color: rgba(100, 181, 246, 0.5);
  text-decoration: none;
  transition: all var(--transition-normal) ease;
  pointer-events: auto;
}

.app-footer a:hover {
  color: rgba(100, 181, 246, 0.8);
  text-decoration: underline;
  opacity: 0.9;
}

.app-footer a:active {
  color: rgba(100, 181, 246, 0.9);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 181, 246, 0.4);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 181, 246, 0.6);
}

::selection {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
  color: var(--white);
}

/* ========================================
   MEDIA QUERIES - RESPONSIVE BREAKPOINTS
   ======================================== */

/* Mobile - Small phones (320px - 480px) - BASE STYLES ABOVE */

/* Mobile - Large phones (481px - 640px) */
@media (min-width: 481px) {
  :root {
    --font-xl: 1.375rem;     /* 22px */
    --font-2xl: 1.75rem;     /* 28px */
    --font-3xl: 2.125rem;    /* 34px */
    --font-4xl: 2.75rem;     /* 44px */
    --spacing-md: 1.75rem;   /* 28px */
  }

  .app-title {
    font-size: var(--font-3xl);
  }

  .weather-main-icon {
    font-size: 4.2rem;
  }

  .weather-temp {
    font-size: 3.2rem;
  }

  .weather-city {
    font-size: var(--font-2xl);
  }
}

/* Tablet - Small tablets (641px - 768px) */
@media (min-width: 641px) {
  :root {
    --font-2xl: 2rem;        /* 32px */
    --font-3xl: 2.375rem;    /* 38px */
  }

  .app {
    padding: var(--spacing-lg);
  }

  .weather-panel {
    max-width: 440px;
  }

  .weather-card {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .weather-main-icon {
    font-size: 5rem;
  }

  .weather-temp {
    font-size: 3.8rem;
  }
}

/* Tablet - Large tablets & small desktops (769px - 1024px) */
@media (min-width: 769px) {
  :root {
    --font-base: 1.0625rem; /* 17px */
    --font-xl: 1.5rem;      /* 24px */
    --font-2xl: 2.25rem;    /* 36px */
    --font-3xl: 2.75rem;    /* 44px */
    --spacing-md: 2rem;     /* 32px */
    --spacing-lg: 2.5rem;   /* 40px */
  }

  .app {
    padding: var(--spacing-xl);
  }

  .weather-panel {
    max-width: 460px;
  }

  .weather-card {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .weather-main-icon {
    font-size: 5.5rem;
  }

  .weather-temp {
    font-size: 4.2rem;
  }

  .app-footer {
    font-size: 0.8125rem;
  }
}

/* Desktop (1025px and up) */
@media (min-width: 1025px) {
  :root {
    --font-base: 1.125rem;  /* 18px */
    --font-lg: 1.25rem;     /* 20px */
    --font-2xl: 2.5rem;     /* 40px */
    --font-3xl: 3rem;       /* 48px */
    --spacing-lg: 3rem;     /* 48px */
    --spacing-xl: 3.5rem;   /* 56px */
  }

  .app {
    padding: var(--spacing-xl);
  }

  .weather-panel {
    max-width: 480px;
  }

  .weather-card {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .app-title {
    font-size: var(--font-4xl);
  }

  .weather-city {
    font-size: 2.25rem;
  }

  .weather-main-icon {
    font-size: 6rem;
  }

  .weather-temp {
    font-size: 4.5rem;
  }
}

/* Large desktop (1441px and up) */
@media (min-width: 1441px) {
  :root {
    --spacing-xl: 4rem;     /* 64px */
  }

  .weather-panel {
    max-width: 500px;
  }
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================
   ACCESSIBILITY - HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: more) {
  .weather-card {
    border-width: 2px;
  }

  .search-form input:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }

  .feedback,
  .loading {
    border-width: 3px;
  }
}

/* ========================================
   DARK MODE (if device prefers)
   ======================================== */

@media (prefers-color-scheme: dark) {
  /* Already using dark theme, so no changes needed */
}

/* ========================================
   LIGHT BACKGROUND FIX FOR NOTCHED DEVICES
   ======================================== */

@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}