:root {
    --primary-color: #007bff;
    --background-color: #ffffff;
    --text-color: #333333;
    --card-background: #f8f9fa;
    --transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  }
  
  [data-theme="dark"] {
    --primary-color: #6c757d;
    --background-color: #212529;
    --text-color: #f8f9fa;
    --card-background: #343a40;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--transition);
  }
  
  body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.6s, color 0.6s;
  }
  
  .container {
    max-width: 800px;
    margin: 0 auto;
    transform-origin: top center;
  }
  
  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    animation: slideDown 0.8s ease-out;
  }
  
  .theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    transform: rotate(0deg);
  }
  
  .theme-toggle:hover {
    transform: rotate(180deg);
  }
  
  .search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    animation: fadeIn 1s ease-out 0.2s backwards;
  }
  
  input {
    flex: 1;
    padding: 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--card-background);
    color: var(--text-color);
    transform: scale(1);
  }
  
  input:focus {
    outline: none;
    border-color: var(--primary-color);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  
  button {
    padding: 15px 30px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transform: translateY(0);
    will-change: transform;
  }
  
  button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
  
  .weather-card {
    background-color: var(--card-background);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: cardEnter 0.6s ease-out forwards;
  }
  
  .weather-info {
    display: grid;
    gap: 1.5rem;
  }
  
  .current-weather {
    display: flex;
    align-items: center;
    gap: 2rem;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
  }
  
  .temperature {
    font-size: 3rem;
    font-weight: bold;
    position: relative;
  }
  
  .temperature::after {
    content: "°C";
    font-size: 1.5rem;
    position: absolute;
    top: 0;
    right: -1.2rem;
  }
  
  .details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.8s ease-out 0.4s backwards;
  }
  
  .detail-item {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    transform: scale(1);
  }
  
  .detail-item:hover {
    transform: scale(1.05);
  }
  
  .loading {
    display: none;
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
  }
  
  .error-message {
    color: #dc3545;
    margin-top: 10px;
    text-align: center;
    animation: shake 0.4s ease-in-out;
    display: none;
  }
  
  .background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    animation: skyGradient 20s infinite alternate;
  }
  
  @keyframes skyGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }
  
  .sunny {
    background: linear-gradient(120deg, #ffd700, #ff8c00, #ff4500);
    background-size: 400% 400%;
  }
  
  .night {
    background: linear-gradient(120deg, #000428, #004e92, #000428);
    background-size: 400% 400%;
  }
  
  .rainy {
    background: linear-gradient(120deg, #1e3c72, #2a5298, #1e3c72);
    background-size: 400% 400%;
  }
  
  .rainy .background-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="0" x2="100" y2="100" stroke="%23ffffff" stroke-width="1" opacity="0.1"/></svg>');
    animation: rain 0.5s linear infinite;
  }
  
  .cloudy {
    background: linear-gradient(120deg, #bdc3c7, #2c3e50);
    background-size: 400% 400%;
  }
  
  .snow {
    background: linear-gradient(120deg, #e0e0e0, #b0bec5);
    background-size: 400% 400%;
  }
  
  .snow .background-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="%23ffffff"/></svg>');
    animation: snow 5s linear infinite;
  }
  
  @keyframes rain {
    from { background-position: 0% 0%; }
    to { background-position: 20% 100%; }
  }
  
  @keyframes snow {
    from { background-position: 0% 0%; }
    to { background-position: 5% 100%; }
  }
  
  @keyframes cardEnter {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
  }
  
  @media (max-width: 480px) {
    .current-weather {
      flex-direction: column;
      text-align: center;
    }
  
    .temperature {
      font-size: 2.5rem;
    }
  
    button {
      padding: 12px 24px;
    }
  
    input {
      padding: 12px;
    }
  }
  