* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #74b9ff, #0984e3, #6c5ce7, #a29bfe);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    color: white;
}

.apphead {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.apphead-icon {
    font-size: 2.2rem;
}

.search {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.button-container {
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.location-btn {
    background: rgba(255, 255, 255, 0.15);
}

.location-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.weatherResult {
    margin-top: 20px;
    text-align: left;
}

.error {
    color: #ff7675;
    font-weight: bold;
    text-align: center;
    padding: 15px;
    background: rgba(255, 118, 117, 0.1);
    border-radius: 10px;
    margin-top: 20px;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.weather-main h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.weather-main p {
    font-size: 1rem;
    opacity: 0.8;
}

.weather-icon {
    width: 80px;
    height: 80px;
}

.temp-display {
    font-size: 3rem;
    font-weight: bold;
    margin: 15px 0;
    text-align: center;
}

.weather-description {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.detail-card:hover {
    transform: translateY(-5px);
}

.detail-card .icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.detail-card .value {
    font-size: 1.2rem;
    font-weight: bold;
}

.detail-card .label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.loading {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.location-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.location-permission {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
}

.location-permission h3 {
    margin-bottom: 10px;
}

.location-permission p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.location-permission button {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    width: auto;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        max-width: 100%;
    }

    .apphead {
        font-size: 2rem;
    }

    .apphead-icon {
        font-size: 2rem;
    }

    .search {
        margin-bottom: 1.2rem;
    }

    .search-input {
        padding: 1rem;
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .button-container {
        gap: 12px;
    }

    button {
        padding: 0.9rem 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 1.2rem;
        border-radius: 15px;
    }

    .apphead {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .apphead-icon {
        font-size: 1.8rem;
    }

    .search {
        margin-bottom: 1rem;
    }

    .search-input {
        padding: 1.1rem;
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    button {
        padding: 0.9rem 0.8rem;
        font-size: 0.95rem;
    }

    .weather-main {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .weather-main h2 {
        font-size: 1.6rem;
    }

    .weather-icon {
        width: 70px;
        height: 70px;
    }

    .temp-display {
        font-size: 2.5rem;
    }

    .weather-description {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .weather-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .detail-card {
        padding: 12px;
    }

    .detail-card .icon {
        font-size: 1.3rem;
    }

    .detail-card .value {
        font-size: 1.1rem;
    }

    .detail-card .label {
        font-size: 0.85rem;
    }
}

/* For very small devices */
@media (max-width: 320px) {
    .container {
        padding: 1rem;
    }

    .apphead {
        font-size: 1.6rem;
    }

    .apphead-icon {
        font-size: 1.6rem;
    }

    .search-input {
        padding: 1rem;
        font-size: 1rem;
    }

    button {
        padding: 0.8rem 0.7rem;
        font-size: 0.9rem;
    }

    .temp-display {
        font-size: 2.2rem;
    }
}