* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #222;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-image 0.5s ease;
}

.card {
    width: 90%;
    max-width: 470px;
    color: #fff;
    border-radius: 20px;
    padding: 40px 35px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 254, 186, 0.3), rgba(91, 84, 138, 0.3));
    z-index: -1;
}

.search-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.search-group {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
}

.search-group input {
    border: 0;
    outline: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 15px 25px;
    height: 50px;
    border-radius: 30px;
    flex: 1;
    font-size: 16px;
    transition: all 0.3s;
}

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

#search-btn {
    background-color: #168877;
    border: none;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    outline: 0;
    width: 50px;
    height: 50px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-btn:hover {
    background-color: #126e60;
    transform: scale(1.05);
}

.unit-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: 50px;
}

.unit-btn {
    border: none;
    background: transparent;
    color: white;
    padding: 0 15px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.unit-btn.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.unit-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.15);
}

.weather-icon {
    width: 140px;
    margin: 10px 0;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.temp {
    font-size: 60px;
    font-weight: 700;
    margin: 10px 0;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.city {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 5px;
}

.time-display {
    font-size: 16px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.description {
    font-size: 20px;
    font-weight: 400;
    margin: 10px 0 20px;
    text-transform: capitalize;
}

.details {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.col {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 10px;
}

.col img {
    width: 40px;
}

.humidity, .wind {
    font-size: 22px;
    font-weight: 500;
}

.error-message {
    color: #ff6b6b;
    font-size: 16px;
    margin-top: 15px;
    font-weight: 500;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #00feba;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

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

@media (max-width: 500px) {
    .card {
        padding: 30px 20px;
    }
    
    .search-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-group {
        width: 100%;
    }
    
    .unit-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .details {
        flex-direction: column;
        gap: 20px;
    }
}