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

body{
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;

    background-color: #001427;
}

.gpa_container{
    margin-top: 10px;
    width: 850px;
    padding: 30px;
    background: #023047;
    border-radius: 15px;
    margin-bottom: 5px;
    box-shadow: 0 15px 40px rgba(0,0,0, 0.35);

    animation: container 0.5s ease;
}


.gpa_container h1{
    text-align: center;
    color: #d68c45;
    font-weight: bold;
    font-size: 27px;
    margin-bottom: 8px;

    animation: title 0.5s ease;
}

.gpa_container > h3 {
    text-align: center;
    color: #f8f9fa;
    margin-bottom: 25px;
    font-weight: bold;
    font-size: 1rem;

    animation: title 0.5s ease;
}

.main_content{
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 45px;
    align-items: flex-start;
    padding: 0 10px;

}

.subjects_section{
    width: 100%;
    max-width: 450px;
    flex: 1;
}

.subject{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    margin-bottom: 12px;

    animation: subject 0.5s ease;
}

.subject:nth-child(1){
    animation-delay: 0.1s;
}

.subject:nth-child(2){
    animation-delay: 0.2s;
}

.subject:nth-child(3){
    animation-delay: 0.3s;
}

.subject:nth-child(4){
    animation-delay: 0.4s;
}

.subject:nth-child(5){
    animation-delay: 0.5s;
}

.subject_top{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.subject_top label{
    font-weight: bold;
    color: #f8f9fa;
    transition: 0.3s ease;
}

.marks {
    width: 100%;
    height: 42px;
    border: 2px solid #212529;
    border-radius: 7px;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    color: #001427;
    background: #f8f9fa;

    transition: border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s ease,
    background 0.3s ease;
}

.marks:hover{
    border-color: #d68c45;
    background: #ffffff;
}

.marks:focus{
    border-color: #d68c45;
    box-shadow: 0 0 0 3px rgba(214, 140, 69, 0.2);
    transform: scale(1.01);
}

.clear_subject{
    border: none;
    background: transparent;
    color: #d68c45;
    font-weight: bold;
    cursor: pointer;
    font-size: 12px;
    transition: color 0.3s ease,
                transform 0.2s ease;
}

.clear_subject:hover{
    color: #d00000;
    text-decoration: underline;
    transform: scale(1.05);
}

.clear_subject:active{
    transform: scale(0.9);
}

button{
    cursor: pointer;
}

.btn_container{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin:15px auto 0;
}

.add_subject_btn, .calc_gpa_btn, .clear_all_btn{
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: bold;
    color: black;
    justify-content: center;
    margin-top: 7px;
    transition: transform 0.25s ease,
                box-shadow 0.25s ease,
                opacity 0.25s ease;
}



.add_subject_btn{
    background: #d68c45;
    color: #001427;
}

.calc_gpa_btn{
    background: #4c956c;
    color: #001427;
}

.clear_all_btn{
    background: #d00000;
    color: #001427;
}

.add_subject_btn:hover, .calc_gpa_btn:hover, .clear_all_btn:hover{
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 7px 15px rgba(0,0,0, 0.25);
}

.add_subject_btn:active, .calc_gpa_btn:active, .clear_all_btn:active{
    transform: translateY(0) scale(0.97);
    box-shadow: none;
}

.result{
    width: 100%;
    height: 125px;
    background: #4c956c;
    border-radius: 10px;
    margin-top: 15px;
    padding: 17px;
    text-align: center;
    transition: 0.3s ease;
}

.result:hover{
    transform: translateY(-4px);
}

.result h3{
    color: #001f27;
    margin-bottom: 5px;
}

.result h2{
    color: #001f27;
    font-size: 28px;
    animation: result 0.5s ease;
}

.result p{
    color: #001f27;
    font-weight: bold;
    font-size: 14px;
    margin-top: 5px;
}

.gpa_categories{
    width: 260px;
    margin-top: 0px;
    animation: categories 0.5s ease both;
}



.gpa_categories h3{
    margin-bottom: 15px;
    color: #f8f9fa;
}

.category{
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #e0fbfc;
    color: #ffba08;
    border-radius: 5px;
    font-size: 14px;
    transition: backgrounf 0.3s ease,
                padding-left 0.3s ease,
                transform 0.3s ease;
}

.category:hover{
    background: rgba(255, 255, 255, 0.08);
    padding-left: 15px;
    transform: translateX(4px);
}

.category span:last-child{
    font-weight: bold;
    color: #ffffff;
}


@keyframes container{
    from{
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to{
        opacity: 1;
        transform: translate(0) scale(1);
    }
}

@keyframes title{
    from{
        opacity: 0;
    }

    to{
        opacity: 1;
    }
}



@keyframes categories{
    from{
        opacity: 0;

    }

    to{
        opacity: 1;
    }
}

@media (max-width: 800px){
    .gpa_container{
        width: 100%;
        max-width: 600px;
    }

    .main_content{
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .subjects_section,
    .gpa_categories{
        width: 100%;
        max-width: 500px;
    }

    .marks{
        width: 100%;
    }

    .add_subject_btn,
    .calc_gpa_btn, 
    .clear_all_btn, .result { 
        width: 100%;
    }

    .gpa_categories{
        margin-top: 0;
    }

}

@media (max-width: 500px){
    body{
        padding: 10px;
    }

    .gpa_container{
        padding: 20px 15px;
        border-radius: 12px;
    }

    .gpa_container h1{
        font-size: 24px;
    }

    .subject{
        align-items: flex-start;
        flex-direction: column;
        gap:5px;
    }

    .subject_top{
        width: 100%;
        justify-content: space-between;
    }

    .marks{
        width: 100%;
    }
}


.subject_name{
    width: 150px;
    border: none;
    outline: none;
    background: transparent;
    color: #f8f9fa;
    font-size: 15px;
    font-weight: bold;

    padding: 3px 0;

    border-bottom: 1px solid transparent;

    transition: 0.3s ease;;
}

.subject_name:focus {
    border-bottom: 1px solid #d68c45;
}

.subject_name:hover{
    border-bottom: 1px solid rgba(214, 140 , 69, 0.5);
}