/* Animated weather background container */
#animated-bg {
    position: fixed;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    opacity: 0.85;
    transition: opacity 0.7s;
}

/* Modern weather card tweaks */
.weather-card {
    background: rgba(255,255,255,0.55);
    border-radius: 2.2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.13);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1.5px solid rgba(255,255,255,0.18);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
}
.weather-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

.weather-card h2 {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #22223b;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.weather-card .weather-anim {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 4px 16px #00A9FF33);
    animation: popIn 0.7s cubic-bezier(.4,0,.2,1);
}

@keyframes popIn {
    0% { transform: scale(0.7) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.temp-main {
    margin-top: 0.5rem;
    margin-bottom: 0.2rem;
}
.feels-like {
    display: block;
    font-size: 1.05rem;
    color: #888;
    margin-top: 0.2rem;
}

@media (max-width: 600px) {
    #animated-bg {
        opacity: 0.7;
    }
    .weather-card {
        padding: 1.1rem 0.5rem;
        border-radius: 1.1rem;
    }
    .weather-card .weather-anim {
        width: 38px;
        height: 38px;
    }
    .temp-main {
        flex-direction: column;
        gap: 0.7rem;
    }
}
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(120deg, #00A9FF, #f8fafc 40%, #0e1e6b 80%, #e0e7ff 100%);
    background-size: 300% 300%;
    animation: gradientMove 6s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.6s;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.container {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  margin: 1rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}


h1 {
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    color: #22223b;
}

.search {
    width: 100%;
    display: flex;
    gap: 0.55rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

#city-input {
    flex: 1;
    padding: 0.85rem 1.2rem;
    border: none;
    border-radius: 2rem;
    font-size: 1.1rem;
    background: rgba(240, 240, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0, 169, 255, 0.07), 0 0 0 0px #00A9FF00;
    transition: box-shadow 0.2s, background 0.2s;
    outline: none;
}

#city-input:focus {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 169, 255, 0.18), 0 0 0 2px #00A9FF44;
    transition: box-shadow 0.2s, background 0.2s;
}

#search-button {
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 2rem;
    background: linear-gradient(90deg, #00A9FF 0%, #00FFD1 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 169, 255, 0.13);
    transition: background 0.2s, transform 0.1s;
}

#search-button:hover {
    background: linear-gradient(90deg, #0090cc 0%, #00cfa0 100%);
    transform: translateY(-2px) scale(1.04);
}

#search-button:active {
    background: linear-gradient(90deg, #0077b6 0%, #00b894 100%);
    transform: scale(0.98);
}

.weather-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.weather-card {
    width: 100%;
    min-height: 180px;
    background: rgba(255,255,255,0.65);
    border-radius: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.13);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    padding: 1.5rem 1.2rem 1.2rem 1.2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(.4,0,.2,1), transform 0.7s cubic-bezier(.4,0,.2,1);
}

.weather-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

.weather-card h2 {
    /* font-size: 1.4rem; */
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #22223b;
    letter-spacing: 0.5px;
}

.weather-card img,
.weather-card .weather-anim {
    width: 80px;
    height: 80px;
    margin: 0.5rem 0;
    display: block;
    filter: drop-shadow(0 4px 16px #00A9FF33);
    animation: popIn 0.7s cubic-bezier(.4,0,.2,1);
}

@keyframes popIn {
    0% { transform: scale(0.7) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.weather-card p {
    margin: 0.2rem 0;
    font-size: 1.05rem;
    color: #22223b;
    font-weight: 400;
    letter-spacing: 0.1px;
}

.loading {
    display: none;
    font-size: 1.1rem;
    color: #00A9FF;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.error {
    color: #ff5252;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    display: none;
}

.refresh-indicator {
    position: relative;
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: #888;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.refresh-indicator.visible {
    opacity: 1;
    animation: fadeIn 1s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Tooltip style for auto-refresh */
.refresh-indicator::before {
    content: "⟳";
    margin-right: 0.4em;
    color: #00A9FF;
    font-size: 1.1em;
    vertical-align: middle;
}

/* Copyright button style */
.copyright-btn {
    margin-top: 1.5rem;
    background: rgba(0, 169, 255, 0.08);
    color: #22223b;
    border: none;
    border-radius: 1.5rem;
    padding: 0.5rem 1.4rem;
    font-size: 0.98rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 169, 255, 0.07);
    transition: background 0.2s, color 0.2s;
    position: relative;
    display: block;
}

.copyright-btn:hover,
.copyright-btn:focus {
    background: #00A9FF;
    color: #fff;
}

/* Optional: Add a loading overlay for initial load */
#preload-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.7s;
    opacity: 1;
    pointer-events: all;
}

#preload-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

.preload-spinner {
    width: 64px;
    height: 64px;
    border: 6px solid #00A9FF;
    border-top: 6px solid #FFC107;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    background: transparent;
}

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

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 1.2rem 0.5rem 1.5rem 0.5rem;
        max-width: 98vw;
        border-radius: 12px;
    }
    .weather-card {
        padding: 1rem 0.5rem;
        border-radius: 1.1rem;
    }
    .search {
        flex-direction: column;
        gap: 0.5rem;
    }
    #search-button {
        width: 100%;
    }
    .weather-card img, .weather-card .weather-anim {
        width: 64px;
        height: 64px;
    }
}
