/* --------------------------------------------------GLOBAL-------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 16px;
    font-family: "Inter", "Abel", sans-serif;
    font-weight: 400;
    font-style: normal;
}

#error {
    display: none;
    visibility: hidden;
    color: #ffffff !important;
    background: #ef4444 !important;
    backdrop-filter: blur(10px);
    padding: 18px 28px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin: 20px auto;
    max-width: 500px;
    width: 90%;
    text-align: center;
    font-weight: 600 !important;
    font-size: 1.1em !important;
    line-height: 1.4 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    box-shadow: 
        0 10px 30px rgba(239, 68, 68, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    position: relative;
}

#error.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

@keyframes slideInError {
    0% {
        transform: translateY(-20px) scale(0.9);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes slideOutError {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-20px) scale(0.9);
        opacity: 0;
    }
}

body {
    background: #1a1a2e;
    min-height: 100vh;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

h1 {
    text-align: center;
    color: #ffffff;
    font-size: 2.5em;
    margin: 40px 0 50px 0;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------FORM-------------------------------------------------- */
#form {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    width: 90%;
    max-width: 500px;
    margin: 0 auto 30px auto;
}

label {
    font-size: 1.2em;
    color: #ffffff;
    margin: 10px 0;
    font-weight: 500;
}

input[type="text"] {
    width: 100%;
    max-width: 350px;
    padding: 16px 24px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.1em;
    margin-bottom: 20px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]::placeholder {
    color: #cccccc;
}

input[type="text"]:focus {
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.1);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

input[type="submit"] {
    padding: 16px 40px;
    border-radius: 50px;
    border: none;
    background: #4a90e2;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}

input[type="submit"]:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(74, 144, 226, 0.4);
}

/* --------------------------------------------------WEATHER-------------------------------------------------- */
.main {
    display: flex;
    flex-direction: column;
    margin: 0 auto 40px auto;
    padding: 0;
    border-radius: 24px;
    width: 90%;
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    position: relative;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-color: rgba(26, 26, 46, 0.9);
}

.main.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

#main-content {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #ffffff;
    padding: 35px 30px;
    margin: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#weather-icon {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    width: calc(100% - 40px);
    color: #ffffff;
    padding: 25px 20px;
    margin: 0 20px 20px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#date {
    font-size: 1.1em;
    color: #e0e0e0;
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#Time, #Hour {
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

#city-name {
    font-size: 2.2em;
    color: #ffffff;
    margin: 0 0 20px 0;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

#Temperature {
    font-size: 4em;
    color: #ffffff;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

#Description {
    font-size: 1.4em;
    color: #ffffff;
    margin: 0;
    text-transform: capitalize;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

#weather-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

#Icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

#FeelsLike, #Humidity {
    font-size: 1.2em;
    color: #ffffff;
    font-weight: 600;
    margin: 0;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    text-align: center;
    flex: 1;
    min-width: 150px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------LOADING-------------------------------------------------- */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 35, 0.9);
    backdrop-filter: blur(10px);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#loading.visible {
    opacity: 1;
    visibility: visible;
}

.container {
    width: 250px;
    height: 250px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cloud {
    width: 250px;
}

.front {
    padding-top: 45px;
    margin-left: 25px;
    position: absolute;
    z-index: 11;
    animation: clouds 8s infinite ease-in-out;
}

.back {
    margin-top: -30px;
    margin-left: 150px;
    z-index: 12;
    animation: clouds 12s infinite ease-in-out;
}

.right-front, .left-front, .right-back, .left-back {
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: inline-block;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.right-front {
    width: 45px; 
    height: 45px;
    border-radius: 50% 50% 50% 0%;
    margin-left: -25px;
}

.left-front {
    width: 65px; 
    height: 65px;
    border-radius: 50% 50% 0% 50%;
}

.right-back {
    width: 50px; 
    height: 50px;
    border-radius: 50% 50% 50% 0%;
    margin-left: -20px;
}

.left-back {
    width: 30px; 
    height: 30px;
    border-radius: 50% 50% 0% 50%;
}

.sun {
    width: 120px;
    height: 120px;
    background: linear-gradient(to right, #f093fb, #f5576c);
    border-radius: 60px;
    position: absolute;
    box-shadow: 0 0 30px rgba(240, 147, 251, 0.5);
}

.sunshine {
    animation: sunshines 2s infinite;
}

/* --------------------------------------------------FOOTER-------------------------------------------------- */
footer {
    text-align: center;
    margin-top: auto;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: #cccccc;
    font-size: 0.95em;
}

footer p {
    margin: 0;
}

footer a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff;
}

/* --------------------------------------------------ANIMATIONS-------------------------------------------------- */
@keyframes sunshines {
    0% { 
        transform: scale(1); 
        opacity: 0.6; 
    }
    100% { 
        transform: scale(1.4); 
        opacity: 0; 
    }
}

@keyframes clouds {
    0% { transform: translateX(15px); }
    50% { transform: translateX(0px); }
    100% { transform: translateX(15px); }
}

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

/* --------------------------------------------------RESPONSIVE-------------------------------------------------- */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
        margin: 20px 0 30px 0;
    }
    
    #form, .main {
        width: 95%;
        padding: 20px 15px;
    }
    
    input[type="text"] {
        max-width: 280px;
        padding: 14px 20px;
    }
    
    input[type="submit"] {
        padding: 14px 30px;
    }
    
    #main-content {
        padding: 25px 20px;
    }
    
    #weather-icon {
        flex-direction: column;
        gap: 15px;
        padding: 20px 15px;
    }
    
    #Temperature {
        font-size: 3em;
    }
    
    #city-name {
        font-size: 1.8em;
    }
    
    #Icon {
        width: 80px;
        height: 80px;
    }
    
    #date {
        flex-direction: column;
        gap: 10px;
    }
    
    #FeelsLike, #Humidity {
        min-width: 120px;
        font-size: 1.1em;
    }
}

@media (min-width: 577px) and (max-width: 992px) {
    #form, .main {
        width: 85%;
    }
    
    #Temperature {
        font-size: 3.5em;
    }
    
    #Icon {
        width: 90px;
        height: 90px;
    }
}

@media (min-width: 993px) {
    #form, .main {
        width: 75%;
    }
    
    body {
        padding: 0 20px;
    }
}

/* --------------------------------------------------SCROLLBAR STYLING-------------------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}
