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

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

body{
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
    pointer-events: none;
}

@keyframes moveBackground {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.card{
    width: 90%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 25px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1{
    font-weight: 700;
    color: #fff;
    font-size: 28px;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.search{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.search input{
    border: 0;
    outline: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 12px 18px;
    border-radius: 25px;
    flex: 1;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search input:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.search input::placeholder {
    color: #999;
}

.btn{
    border: 0;
    border-radius: 25px;
    outline: 0;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn:active {
    transform: translateY(0);
}

/* weather start*/

.weather-icon{
    width: 140px;
    margin-top: 10px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.weather {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.weather.show {
    display: block;
}

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

.weather h1{
    font-size: 64px;
    font-weight: 600;
    margin: 5px 0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.weather h2{
    font-size: 32px;
    font-weight: 500;
    margin-top: -5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.weather-condition {
    font-size: 16px;
    font-weight: 400;
    margin-top: 5px;
    opacity: 0.9;
    text-transform: capitalize;
}

/* Card section start*/

.details{
    display: none;
    justify-content: space-around;
    padding: 0 5px;
    margin-top: 25px;
    gap: 10px;
    flex-wrap: wrap;
}

.details.show {
    display: flex;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.col{
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 12px;
    border-radius: 15px;
    flex: 1;
    min-width: 120px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.col:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.col img{
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.card-details {
    text-align: left;
}

.humidity,
.wind,
.Air-pressure,
.wind-speed{
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 3px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.card-details p:last-child {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.degree-btn{
    display: none;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.degree-btn.show {
    display: flex;
    animation: fadeIn 0.5s ease-out 0.4s both;
}

.btn-item1,
.btn-item2{
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 24px;
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-item1:hover,
.btn-item2:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-item1.active,
.btn-item2.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.err{
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    display: none;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.err.show {
    display: block;
}

/* Responsive Design */
@media (max-width: 480px) {
    .card {
        padding: 25px 20px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .weather h1 {
        font-size: 56px;
    }
    
    .weather h2 {
        font-size: 28px;
    }
    
    .weather-icon {
        width: 120px;
    }
    
    .search {
        flex-direction: column;
    }
    
    .search input {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .btn {
        width: 100%;
    }
    
    .details {
        flex-direction: column;
        margin-top: 20px;
    }
    
    .col {
        width: 100%;
        justify-content: center;
    }
}