*{
    box-sizing: border-box;
}

body{
    margin: 0;
    padding: 0;
    background-color: #f2f2f2;
}


/*-------------HEADER--------------*/
header{
    width: 100%;
    height: auto;
}

.header-container{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

h2 {
    font: 600 2em/1.2em "Trebuchet MS";
    text-align: center;
    margin: 40px 0px 10px 0px;
    color:#545353;
}

header p {
    font: 500 0.845em/1.5em "Trebuchet MS";
    text-align: justify;
    max-width: 600px;
    line-height: 1.6em;
    color: #555; 
    margin: 10px auto 30px;
    padding: 10px;
    width: 95%;
}

.header-calculator{
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    padding: 50px;
    border-radius: 10px;
    flex-wrap: wrap;
}

.header-calculator:hover{
    box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.3), -6px -6px 6px rgb(255, 255, 255);
}

.header-calculator > div{
    display: flex;
    width: 100%;
    margin-bottom: 30px;
}

.header-calculator label, span{
    font: 500 0.845em/1em "Trebuchet MS";
}

.header-first{
    display: flex;
}

#header-age{
    width: 50%;
    display: flex;
}

#header-age label{
    width: 20%;
    align-self: center;
}

#header-age input{
    width: 80%;
}

#header-gender{
    width: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
}

#header-gender, #header-weight{
    margin-left: 15px;
}

#header-second{
    display:flex;
}

#header-height, #header-weight{
    width: 50%;
    display: flex;
}

#header-height label, #header-weight label{
    width: 20%;
    align-self: center;
}

#header-height input, #header-weight input{
    width: 50%;
}

#header-height select, #header-weight select{
    width: 30%;
}

#header-activity, #header-formula{
    width: 100%;
    display: flex;
    flex-direction: column;
}

#header-activity label, #header-formula label{
    padding-bottom: 5px;
}

.header-info > input[type="text"]{
    margin-right: 5px;
    text-align: right;
}


.header-info > input[type="text"],
.header-info > input[type="number"],
.header-info > select{
    border-radius: 5px;
    outline: none;
    border: 0;
    font: 500 0.845em/1em "Trebuchet MS";
    color: #182b59;
    padding: 10px;
}

input[type="submit"]{
    border-radius: 5px;
    background-color: #2e59bc;
    color: white;
    border: 0;
    cursor: pointer;
    font: 500 0.845em/1em "Trebuchet MS";
    height: 40px;
    margin: 20px 0px;
}

input[type="submit"]:hover{
    background-color: #3668dd;
}

#header-activity > label::after,
#header-formula > label::after{
    content: url("../graphics/svg/info-black.svg");
    float: right;
    align-items: center;
    text-align: center;
    justify-content: center;
    pointer-events: none;
}

#header-activity > label:hover::after,
#header-formula > label:hover::after{
    content: url("../graphics/svg/info-gray.svg");
}

select {
    appearance: none; 
    background: url('../graphics/buttons/arrow-down.png') no-repeat right 10px center;
    background-color: #ffffff;
    border-radius: 5px;
    outline: none;
    background-size: 20px;
    height: 35px;
    font: 500 0.8em/1em "Trebuchet MS";
}

/*---SLIDER---*/

/* Container styling */
.katch-mcardle-container {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 10px 0;
    display: none;
}

.katch-mcardle-container > label {
    width: 15%;
    font: 500 0.845em/1em "Trebuchet MS";
}

.katch-mcardle-container > input[type="number"]{
    border-radius: 5px;
    outline: none;
    border: 0;
    font: 500 0.845em/1em "Trebuchet MS";
    color: #182b59;
    padding: 10px;
}

.katch-mcardle-container > input[type="range"] {
    width: 60%;
    max-width: 290px;
    -webkit-appearance: none; /* Remove default styling */
    appearance: none;
    background: #ddd;
    height: 8px;
    border-radius: 5px;
    outline: none;
    margin: 0 20px;
}

/* Thumb (draggable circle) customization */
.katch-mcardle-container > input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}

.katch-mcardle-container > input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}

.katch-mcardle-container > input[type="range"]::-ms-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}

/* Span styling */
.katch-mcardle-container > span {
    width: 20%;
    text-align: center;
    font: 500 0.845em/1em "Trebuchet MS";
}

.katch-mcardle-container > #sliderValue::after {
    content: "%";
    font: 500 0.845em/1em "Trebuchet MS";
}

.katch-mcardle-container > #sliderValue {
    width: 20%;
    margin: 0;
    text-align: left;
    font: 500 0.845em/1em "Trebuchet MS";
}

/*-------------MAIN--------------*/

main{
    width: 100%;
    height: auto;
}

.main-container{
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: 150px 0px;
}

.main-statistics, .main-info{
    width: 100%;
}

.main-info{
    max-width: 90%;
    align-self: center;
}

.main-info > p:first-child{
    font: 600 2em/1em "Trebuchet MS";
    text-align: center;
}

.main-info > p:not(:first-child){
    font: 500 0.845em/1em "Trebuchet MS";
    display: inline-block;
    width: 19%;
    background-color:#2e59bc;
    color: white;
    padding: 10px;
    border-radius: 5px;
}

.main-statistics{
    max-width: 90%;
    align-self: center;
    display: flex;
}

.main-statistics > div{
    width: 31.3%;
}

.main-statistics > div:nth-child(2){
    margin: 0px 1%;
}

table{
    width: 100%;
    border-radius: 10px;
    border-collapse: collapse;
    margin: 20px 0px;
    box-shadow: 6px 6px 10px rgba(0, 0, 0, 0.1), -6px -6px 10px rgb(255, 255, 255);
}

table th{
    padding: 20px;
    width: 100%;
    font: 600 0.845em/1em "Trebuchet MS";
}

table th::after{
    content: url("../graphics/svg/info-black.svg");
    float: right;
    align-items: center;
    text-align: center;
    justify-content: center;
    pointer-events: none;
}

table th:hover::after{
    content: url("../graphics/svg/info-gray.svg");
}

table tr{
    border-bottom: 1px solid #e6e6e6;
    font: 500 0.9em/1em "Trebuchet MS";
}

table td{
    padding: 10px;
    width: 50%;
    font: 500 0.9em/1em "Trebuchet MS";
    padding: 15px 20px;
}

table td:nth-child(2){
    text-align: right;
}

table td span{
    font: 500 0.9em/1em "Trebuchet MS";
    color: #224189;
}

/*-------------SECTION--------------*/

section{
    width: 100%;
    height: auto;
    background-color: #f5f5f5;
    padding: 50px 0px;
}

.section-container{
    width: 90%;
    margin: auto;
}

.section-info{
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto;
    margin: 40px auto 80px;
}

.section-info p{
    font: 500 1em/1em "Trebuchet MS";
    text-align: justify;
    max-width: 1000px;
    line-height: 1.6em;
    color: #555; 
    margin: 5px auto 10px;
}

#title-formula{
    width: 100%;
    font: 600 0.845em/1em "Trebuchet MS";
    text-align: left;
    margin: 10px auto 10px;
}

p strong, strong{
    color: #2e59bc;
    text-align: right;
}

section img{
    align-self: center;
    margin: 20px 0px;
}

#bmi-formula-standard{
    max-width: 200px;
}

#bmi-formula-imperial{
    width: 250px;
}

section table{
    width: 100%;
    max-width: 600px;
    margin: 40px auto 40px;
    border-radius: 10px;
    border-collapse: collapse;
    box-shadow:6px 6px 10px rgba(0, 0, 0, 0.1), -6px -6px 10px rgb(255, 255, 255);
}

#bmr-formula{
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
}

#bmr-katch-lbm-formula{
    width: 400px;
}

#bmr-katch-formula{
    width: 300px;
}

#tdee-table td{
    width: 33.33%;
}

hr{
    border: 1px solid #e7e7e7;
    width: 1000px;
}

#tdee-formula{
    width: 300px;
}

#protein-intake-formula{
    width: 400px;
}


@media screen and (max-width: 980px) {
    /*----MAIN-----*/
    .main-statistics {
        display: flex;
        flex-direction: column;
    }

    .main-statistics > div > p:nth-child(1) {
        text-align: center;
        font: 600 1em/1em "Trebuchet MS";
        border: 1px solid black;
        padding: 5px;
    }

    .main-statistics > div {
        width: 100%;
        align-self: center;
    }

    .main-statistics > p {
        width: 50%; /* Set width to 50% */
        text-align: center; /* Center the text inside the element */
        margin: 0 auto; /* Center the element itself */
    }
}

@media screen and (max-width: 650px) {
    /*----HEADER-----*/

    .header-calculator{
        padding: 30px;
    }

    .header-calculator > div{
        flex-direction: column;
        margin-bottom: 15px;
    }

    .header-first, .header-second {
        flex-direction: column;
    }

    #header-age, #header-gender, #header-height, #header-weight {
        width: 100%;
        margin-bottom: 20px;
    }

    #header-age label{
        width: 20%;
    }

    #header-age input{
        width: 80%;
    }

    #header-gender{
        margin: 0;
    }

    #header-gender span{
        margin-right: 30px;
    }

    #header-height, #header-weight{
        margin-left: 0px;
    }

    #header-height label, #header-weight label{
        width: 20%;
        padding: 0;
    }

    #header-height input, #header-weight input{
        width: 50%;
    }

    #header-height select, #header-weight select{
        width: 30%;
    }

    .header-info > input[type="text"], 
    .header-info > input[type="number"], 
    .header-info > select {
        width: 100%;
    }

    .katch-mcardle-container > label{
        width: 100%;
    }

    .katch-mcardle-container > #bodyFat{
        width: 180%;
        margin: 0;
        padding: 0;
    }
    .katch-mcardle-container > #sliderValue{
        width: 100%;
        margin-top: 10px;
    }
}

