/* Color Pallete */
:root {
  --bg-color: #F4F8FB;
  --card-color: #FFFFFF;
  --primary-color: #3B82F6;
  --primary-hover: #2563EB;
  --title-color: #0F172A;
  --text-color: #334155;
  --muted-color: #64748B;
  --border-color: #DCE7F3;
  --shadow-color: rgba(15, 23, 42, 0.08);

  --success-color: #22C55E;
  --error-color: #EF4444;
  --warning-color: #F59E0B;

  --temp-color: #1D4ED8;
  --info-bg: #EFF6FF;
}

* {
    margin: 0;
}

body {
    margin: 0 auto;
    padding: 0;
    box-sizing:border-box;
    font-family: 'Inter';
    font-size: 16px;
}

header {
    padding: 1.5rem 2rem 1.5rem 4rem;
    background-color: rgba(59, 130, 246, 0.08);
    color: #0F172A;
}

#subtitle, #main_heading {
    color: #64748B;
    max-width: 1100px;
    margin: 0 auto;
}

main {
    background: var(--bg-color);
    min-height: 100vh;

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.user_input {
    max-width: 1100px;
    margin: 3rem 0rem 3rem 6rem; 

    display: flex;
    justify-content: center;
    gap: 1rem;
}

.search_bar {
    height: 1.5rem;
    width: 25rem;
    padding: 1rem 1rem 1rem 2rem;
    font-size: 1rem;
    background-color: var();

    border: none;
    border-radius: 50px;
    border-style: solid;
    border-width: 1px;
    border-color: var(--border-color);
}

.search_bar:focus {
    outline: none;
    border: none;
    border-radius: 50px;
    border-style: solid;
    border-width: 1px;
    border-color: var(--border-color);
}

.search_button:hover {
    background-color:var(--primary-hover);
}

.search_button {
    width: 8rem;
    background-color: var(--primary-color);
    color: var( --card-color);
    font-size: 1rem;

    border: none;
    border-radius: 50px;
    border-width: 1px;
    border-color: var(--border-color);
}

.weather_section {
    display: flex;
    flex-wrap: wrap;

    max-width: 1100px;
}

.weather_card {
    min-width: 20rem;
    max-width: 20rem;
    max-height: 25rem;
    margin: 0;
    padding: 1.8rem 1rem 2rem 1rem;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    background-color: var(--card-color);
    color: var(--text-color);
    border: var(--border-color) solid 1px;
    border-radius: 20px;
    box-shadow: 2px 2px 5px var(--shadow-color);
    transition: all 0.4s ease-in-out;
}

.weather_card:hover {
    transform: scale(1.05);
}

.weather_icon {
    width: 12%;
}

.city {
    font-size: 1.5rem;
}

.temperature {
    font-size: 4rem;
    margin: 1rem 0rem;
    color:var(--temp-color);
}

.cloud {
    color:var(--muted-color);
}

.info_box {
    min-height: 4.5rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.box_info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;

    background-color:var(--info-bg);
    border-radius: 10px;
    padding: 0.5rem;
}

.box_cat {
    min-width: 5rem;
    text-align: center;
}

.loading {
    margin-top: 5rem;
    height: 3rem;
    width: 3rem;
    border: var(--primary-color) solid 5px;
    border-radius: 50%;
    border-bottom-color: rgba(0, 0, 0, 0);

    animation-name: loading;
    animation-duration: 2s;
    animation-iteration-count: infinite;
}

@keyframes loading {
    0% { 
        transform: rotate(1deg);
    }
    100% {
        transform: rotate(720deg);
    }
}

.error_message {
    color:var(--error-color);
    font-size: 2rem;
    text-align: center;
}

.introduction {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-color);
}

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

@media (max-width: 600px) {

    header {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }

    #subtitle, #main_heading {
        max-width: 100%;
        text-align: center;
    }

     main {
        gap: 2rem;
    }

    .user_input {
        max-width: 100%;
        margin: 0;
    }

    .search_bar {
        width: 15rem;
    }

    .search_button{
        width: 5rem;
    }

    .weather_section{
        padding: 1.5rem;
    }
}

