@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

body {
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(to bottom, #00c6ff, #0072ff);
    color: #fff;
    transition: background-color 0.5s, color 0.5s;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 20px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.heading {
    font-size: 2em;
    font-weight: bold;
    animation: headingAnimation 1s ease-in-out;
    margin: 10px 0;
    text-align: center;
    flex: 1 0 100%;
}

.dark-mode-toggle {
    background-color: #2b6cb0;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 10px 0;
    flex: 0 0 auto;
}

.dark-mode-toggle:hover {
    background-color: #23425e;
}

.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease-in-out;
    gap: 10px;
}

.search-input {
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    width: calc(100% - 20px);
    max-width: 300px;
    transition: border-color 0.3s ease-in-out;
}

.search-input:focus {
    border-color: #2b6cb0;
    outline: none;
}

.search-button, .location-button {
    background-color: #2b6cb0;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex: 1 0 auto;
}

.search-button:hover, .location-button:hover {
    background-color: #23425e;
}

.weather-container {
    text-align: center;
}

.weather-info {
    background: linear-gradient(to bottom, #00c6ff, #0072ff);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1s ease-in-out;
}

.temperature-chart {
    margin-top: 20px;
}

.loading-spinner {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #3498db;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
    margin: 0 auto;
}

.dark-mode {
    background: linear-gradient(to bottom, #1a202c, #2d3748);
    color: #cbd5e0;
}

.dark-mode .container {
    background-color: #2d3748;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.dark-mode .search-input {
    background-color: #4a5568;
    color: #cbd5e0;
    border: 1px solid #718096;
}

.dark-mode .search-button, .dark-mode .location-button {
    background-color: #718096;
}

.dark-mode .dark-mode-toggle {
    background-color: #4a5568;
}

.dark-mode .dark-mode-toggle:hover {
    background-color: #2c3a47;
}


.footer {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.dark-mode .footer {
    background-color: #2d3748;
    color: #cbd5e0;
}

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

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes headingAnimation {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .search-bar {
        flex-direction: column;
        width: 100%;
    }

    .search-input, .search-button, .location-button, .dark-mode-toggle {
        width: 100%;
        margin: 5px 0;
    }

    .heading {
        font-size: 1.5em;
    }
}
