* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  body {
    height: 100vh;
    background: linear-gradient(135deg, #1f1c2c, #928dab);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background 0.7s ease;
  }
  
  .weather-app {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 3rem 2.5rem;
    width: 380px;
    box-shadow:
      0 8px 32px 0 rgba(31, 38, 135, 0.37),
      0 0 1rem 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    color: #e0e0e0;
    position: relative;
    transition: box-shadow 0.3s ease;
  }
  
  .weather-app:hover {
    box-shadow:
      0 12px 40px 0 rgba(31, 38, 135, 0.6),
      0 0 1.5rem 0 rgba(255, 255, 255, 0.2);
  }
  
  h1 {
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1.8rem;
    color: #ffffffcc;
    letter-spacing: 1.2px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
  }
  
  .search-container {
    display: flex;
    align-items: center;
    justify-content: space-between;  /* search bar left, toggle right */
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 380px;
  }
  
  .search {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 0.3rem 0.5rem;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    min-width: 0;
  }
  
  .search input {
    flex-grow: 1;
    min-width: 0;
    padding: 0.6rem 1rem;
    border-radius: 15px 0 0 15px; /* round left corners */
    border: none;
    background: transparent;
    color: #f0f0f0;
    font-size: 1rem;
    box-shadow: none;
    transition: background 0.3s ease;
  }
  
  .search input::placeholder {
    color: #d3d3d3aa;
  }
  
  .search input:focus {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    box-shadow: 0 0 15px #7a7a9d;
  }
  
  .search button {
    flex-shrink: 0;
    min-width: 90px;
    padding: 0.6rem 1rem;
    border-radius: 0 15px 15px 0; /* round right corners */
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 15px #667eea88;
    transition: background 0.3s ease, box-shadow 0.3s ease;
  }
  
  .search button:hover,
  .search button:focus {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    box-shadow: 0 0 25px #7f7fffcc;
    outline: none;
  }
  
  /* Toggle switch styling */
  .switch {
    flex-shrink: 0;
    width: 44px;
    height: 22px;
    vertical-align: middle;
    user-select: none;
    position: relative;
    display: inline-block;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #55557788;
    transition: 0.4s;
    border-radius: 34px;
    box-shadow: inset 0 0 6px #000000aa;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: #f0f0f0;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 0 5px #6666ccaa;
  }
  
  input:checked + .slider {
    background-color: #6b46c1cc;
    box-shadow: 0 0 10px #9066d8cc;
  }
  
  input:checked + .slider:before {
    transform: translateX(22px);
    box-shadow: 0 0 15px #d3bbffcc;
  }
  
  .message {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #ffcc00cc;
    text-shadow: 0 0 5px #ffcc0044;
    min-height: 1.2rem;
  }
  
  .weather-info h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 10px #9999ffbb;
  }
  
  .weather-info p {
    font-size: 1.1rem;
    margin: 0.2rem 0;
    text-transform: capitalize;
    text-shadow: 0 0 5px #7777aa88;
  }
  
  #weatherIcon {
    width: 100px;
    height: 100px;
    margin: 1rem 0;
    filter: drop-shadow(0 0 5px #bbbbeeaa);
    transition: filter 0.3s ease;
  }
  
  #weatherIcon:hover {
    filter: drop-shadow(0 0 15px #aabbffcc);
  }
  
  .spinner {
    margin: 0 auto 1rem;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }
  