:root {
    --background-light: #f0f8ff;
    --background-dark: #2c2c2c;
    --text-light: #000;
    --text-dark: #fff;
  }

  body {
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--background-light);
    color: var(--text-light);
    transition: background 0.5s, color 0.5s;
  }

  body.dark {
    background-color: var(--background-dark);
    color: var(--text-dark);
  }

  /* Theme Toggle Switch */
  .theme-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
  }

  /* Toggle Container */
  .toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    background: #ddd;
    border-radius: 20px;
    transition: background 0.3s ease;
  }

  /* Toggle Circle */
  .toggle-switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
  }

  /* Dark Mode Active */
  .dark .toggle-switch {
    background: #3f3f3f;
  }

  .dark .toggle-switch::before {
    transform: translateX(20px);
  }

  /* Hide Default Checkbox */
  #themeToggle {
    display: none;
  }

  /* App Container */
  .app {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    margin-top: 80px;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    border-radius: 8px;
    z-index: 2;
  }

  .dark .app {
    background: rgba(40, 40, 40, 0.9);
  }

  input,
  button {
    padding: 8px;
    margin: 10px 0;
  }

  button {
    cursor: pointer;
  }

  #weatherDisplay {
    margin-top: 15px;
  }

  .weather-icon {
    width: 100px;
    height: 100px;
    margin: 10px 0;
  }

  .error {
    color: red;
  }

  /* Spinner */
  .spinner {
    display: none;
    margin: 20px auto;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  /* Footer */
  .footer {
    margin-top: auto;
    width: 100%;
    padding: 20px 10px;
    text-align: center;
    background: rgba(0, 0, 0, 0.05);
  }

  .dark .footer {
    background: rgba(255, 255, 255, 0.05);
  }

  .footer-logo {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
  }

  .footer a {
    color: inherit;
    text-decoration: none;
    font-weight: bold;
  }

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