/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #112d4e;
    --color-accent: #3f72af;
    --color-light: #f9f7f7;
    --color-soft: #dbe2ef;
    --glass: rgba(255, 255, 255, 0.08);
    --blur: blur(10px);
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s ease;
    font-family: "Poppins", sans-serif;
    scroll-behavior: smooth;
    color: var(--color-light);
}

/* ===== BODY & WRAPPER ===== */
body {
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);

    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
}

.wrapper {
    width: 100%;
    max-width: 800px;
    background: var(--glass);
    backdrop-filter: var(--blur);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* ===== HEADINGS ===== */
h1 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 2rem;
    color: var(--color-light);
    text-shadow: var(--text-shadow);
}

/* ===== TABS ===== */
.tabContainer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab {
    flex: 1 1 45%;
    padding: 0.8rem 1.2rem;
    text-align: center;
    border-radius: 30px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    font-weight: 600;
    letter-spacing: 1px;
    color: white;
}

.tab:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tab.currentTab {
    background-color: white;
    color: var(--color-bg);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
    letter-spacing: 1px;
}

.btn:hover {
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 114, 255, 0.5);
}

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 114, 255, 0.4);
}


/* ===== FORMS ===== */
.formContainer {
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.formContainer.active {
    display: flex;
}

.formContainer input {
    flex: 1;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    transition: var(--transition);
}

.formContainer input::placeholder {
    color: #eee;
}

.formContainer input:focus {
    border: 1px solid white;
}

/* ===== GRANT LOCATION ===== */
.grantLocationContainer {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.grantLocationContainer.active {
    display: flex;
}

.grantLocationContainer p {
    font-size: 1rem;
    color: var(--color-soft);
}

/* ===== LOADING ===== */
.loadingContainer,
.errorContainer,
.userInfoContainer {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 0;
}

.loadingContainer.active,
.errorContainer.active,
.userInfoContainer.active {
    display: flex;
}

/* ===== WEATHER INFO ===== */
.name {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.userInfoContainer p[data-temp] {
    font-size: 3rem;
    font-weight: 700;
}

.userInfoContainer p[data-weatherDesc] {
    text-transform: capitalize;
    font-size: 1.25rem;
    color: var(--color-soft);
    font-weight: 500;
}

.name img {
    height: 60px;
    width: 80px;
}

/* ===== WEATHER CARDS ===== */
.parameterContainer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.parameter {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    min-width: 120px;
    flex: 1 1 30%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease;
}

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

.parameter img {
    width: 40px;
    margin-bottom: 0.5rem;
}

.parameter p {
    font-size: 0.95rem;
    color: #eee;
}

.parameterValue {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

/* ===== ERROR MESSAGE ===== */
.errorContainer p {
    font-size: 1rem;
    color: #ffbaba;
}

.errorContainer img {
    width: 120px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }

    .tab {
        flex: 1 1 100%;
    }

    .formContainer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .parameter {
        flex: 1 1 100%;
    }

    .name {
        flex-direction: column;
    }
}