*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Merriweather Sans', sans-serif;
}

:root {
    --colorDark1: #112D4E;
    --colorDark2: #3F72AF;
    --colorLight1: #DBE2EF;
    --colorLight2: #F9F7F7;
}

.wrapper {
    width: 100vw;
    min-height: 100vh;
    color: var(--colorLight2);
    background: linear-gradient(160deg, #112d4e 0%, #3f72af 100%);
    position: relative;
    overflow-x: hidden;
}

/* Animated background elements */
.wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.1), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.1), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.1), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.1), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
    pointer-events: none;
}

@keyframes sparkle {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

/* Floating cloud elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.cloud-1, .cloud-2, .cloud-3 {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    opacity: 0.6;
}

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 20%;
    left: -100px;
    animation: float-cloud 25s linear infinite;
}

.cloud-2 {
    width: 80px;
    height: 30px;
    top: 40%;
    left: -80px;
    animation: float-cloud 20s linear infinite 5s;
}

.cloud-3 {
    width: 120px;
    height: 50px;
    top: 60%;
    left: -120px;
    animation: float-cloud 30s linear infinite 10s;
}

@keyframes float-cloud {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

.heading {
    text-align: center;
    text-transform: uppercase;
    padding-top: 60px;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: fadeInDown 1s ease-out;
    position: relative;
    z-index: 1;
    background: linear-gradient(45deg, #F9F7F7, #DBE2EF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.heading.inactive {
    opacity: 0;
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.tab-container {
    width: 90%;
    max-width: 550px;
    margin: 0 auto;
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    animation: slideInUp 1s ease-out 0.3s both;
    position: relative;
    z-index: 1;
    gap: 20px;
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-container.inactive {
    display: none;
}

.tab {
    cursor: pointer;
    font-size: 0.875rem;
    letter-spacing: 1.75px;
    padding: 12px 20px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    text-align: center;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.tab:hover::before {
    left: 100%;
}

.tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background-color: rgba(219, 226, 239, 0.2);
}

.tab.current-tab {
    background: rgba(219, 226, 239, 0.3);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.weather-container {
    margin-block: 4rem;
    position: relative;
    z-index: 1;
}

/* Enhanced buttons */
.btn {
    all: unset;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-radius: 25px;
    background: linear-gradient(145deg, var(--colorDark2), #2a5a94);
    cursor: pointer;
    padding: 12px 30px;
    margin-bottom: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    font-weight: 600;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(-1px);
}

/* Pulse animation for grant access button */
.pulse-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(63, 114, 175, 0.3);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 20px rgba(63, 114, 175, 0);
    }
}

.sub-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Grant location container */
.grant-location-container {
    display: none;
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.grant-location-container.active {
    display: flex;
}

.location-icon {
    margin-bottom: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.grant-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.grant-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2rem;
    letter-spacing: 0.75px;
    opacity: 0.9;
}

/* Enhanced search form */
.form-container {
    display: none;
    max-width: 550px;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 3rem;
    animation: slideInUp 0.6s ease-out;
}

.form-container.active {
    display: flex;
}

.search-input-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.form-container input {
    all: unset;
    width: 100%;
    height: 50px;
    padding: 0 25px;
    background: rgba(219, 226, 239, 0.15);
    border-radius: 25px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.form-container input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-container input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(219, 226, 239, 0.25);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.search-btn {
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 0;
}

/* Enhanced loading animation */
.loading-container {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.loading-container.active {
    display: flex;
}

.loading-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
}

.spinner-ring {
    position: absolute;
    border: 4px solid transparent;
    border-top: 4px solid var(--colorLight2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(1) {
    width: 120px;
    height: 120px;
    animation-duration: 1s;
}

.spinner-ring:nth-child(2) {
    width: 90px;
    height: 90px;
    top: 15px;
    left: 15px;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 30px;
    left: 30px;
    animation-duration: 2s;
}

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

.loading-text {
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 2px;
    animation: pulse-text 2s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Weather info container */
.user-info-container {
    display: none;
    animation: fadeInUp 0.8s ease-out;
}

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

.user-info-container.active {
    display: flex;
}

.name {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
    animation: slideInLeft 0.6s ease-out 0.2s both;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.name p {
    font-size: 2rem;
    font-weight: 600;
}

.name img {
    width: 40px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
}

.weather-desc {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    text-transform: capitalize;
    animation: slideInRight 0.6s ease-out 0.3s both;
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.weather-icon-container {
    margin-bottom: 1rem;
    animation: bounceIn 0.8s ease-out 0.4s both;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.weather-icon-container img {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.temperature {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: zoomIn 0.6s ease-out 0.5s both;
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced parameter cards */
.parameter-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: slideInUp 0.8s ease-out 0.6s both;
}

.parameter {
    width: 160px;
    background: rgba(219, 226, 239, 0.15);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.parameter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.parameter:hover::before {
    opacity: 1;
}

.parameter:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    background: rgba(219, 226, 239, 0.25);
}

.parameter-icon {
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.parameter:hover .parameter-icon {
    transform: scale(1.1);
}

.parameter-label {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.parameter-value {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Individual card animations */
.wind-card {
    animation: slideInUp 0.6s ease-out 0.7s both;
}

.humidity-card {
    animation: slideInUp 0.6s ease-out 0.8s both;
}

.cloud-card {
    animation: slideInUp 0.6s ease-out 0.9s both;
}

/* Enhanced error container */
.err-container {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: shake 0.8s ease-out;
}

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

.err-container.active {
    display: flex;
}

.error-animation {
    margin-bottom: 2rem;
    color: #ff6b6b;
    animation: pulse-error 2s infinite;
}

@keyframes pulse-error {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.error-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ff6b6b;
}

.error-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .heading {
        font-size: 2rem;
        padding-top: 40px;
    }
    
    .tab-container {
        flex-direction: column;
        gap: 10px;
        margin-top: 2rem;
    }
    
    .parameter-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .parameter {
        width: 200px;
    }
    
    .form-container {
        flex-direction: column;
        gap: 15px;
        padding: 0 20px;
    }
    
    .search-input-container {
        width: 100%;
    }
    
    .temperature {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .wrapper {
        padding: 0 15px;
    }
    
    .heading {
        font-size: 1.5rem;
    }
    
    .tab {
        font-size: 0.75rem;
        padding: 10px 15px;
    }
    
    .parameter {
        width: 180px;
        padding: 1rem;
    }
    
    .grant-title {
        font-size: 1.5rem;
    }
    
    .name p {
        font-size: 1.5rem;
    }
}