/* General Configs */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

a {
    text-decoration: none;
    color: var(--boxFontColor);
}

:root {
    font-size: 62.5%;
    font-family: sans-serif;
}

.darkMode {
    /* --Background:#070707; */
    --Background: #131313;
    --fontColor: #fff;
    --boxFontColor: #000000c5;
    --workoutBackground: #dddddd;
    --tagColor: #00000054;
}

/* Scrollbar */

body::-webkit-scrollbar {
    width: .5rem;
    height: .5rem;
    cursor: none;
}

body::-webkit-scrollbar-track {
    background: transparent;
    padding: 2px;

}

body::-webkit-scrollbar-thumb {
    background: var(--workoutBackground);
    border-radius: 8px;
    cursor: none;

}

body {
    width: 100%;
    min-height: 100vh;
    max-height: 100%;
    font-size: 1.6rem;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: normal;
    font-style: normal;
    background-color: var(--Background);
    color: var(--fontColor);
}

.title2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.title3 {
    font-size: 2.5rem;
    color: var(--boxFontColor);
}

.tagForSearch {
    display: none;
}

h4 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--fontColor);
    margin-bottom: 1rem;
}

main {
    padding: 0 2.5rem;
}

header {
    height: 15rem;
    height: 5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem;
    margin-bottom: 1rem;
}

.profileSection {
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
}

.userName {
    font-size: 1.2rem;
}

.userImage {
    height: 4rem;
    width: 4rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    align-self: center;
    justify-self: center;
    border: .1px solid var(--workoutBackground);
}

.searchArea {
    width: 55%;
    display: inline-flex;
    justify-content: center;
    position: relative;
}

.searchArea i {
    position: absolute;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.808);
    right: 1.2rem;
    top: .8rem;
    cursor: pointer;
}

input[type="search"] {
    cursor: pointer;
    outline: none;
    border: none;
    border-radius: 16px;
    height: 3.2rem;
    width: 100%;
    padding: 1rem 2rem;
    color: var(--fontColor);
    background: #ffffff28;
    appearance: none;
    position: relative;
}

input[type="search"]:focus {
    outline: .1px solid var(--workoutBackground);
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

section {
    margin-bottom: 4rem;
}

/* Workouts Functions */
.workoutsFunctions {
    display: flex;
    justify-content: initial;
    gap: 2rem;
    margin-bottom: 4rem;
}

.workoutsFunctions i,
#closeModal,
#closeNewExerciseModalBtn {
    background-color: rgba(255, 255, 255, 0.082);
    border-radius: 50%;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.workoutsFunctions i:hover {
    scale: 1.1;
}

.workoutsFunctions #add:hover {
    background-color: rgba(0, 255, 21, 0.233);
}

.workoutsFunctions #remove:hover {
    background-color: rgba(255, 0, 0, 0.5);
}

.workoutsFunctions #edit:hover {
    background-color: rgba(251, 255, 0, 0.384);
}

/* Train Area */

.workoutsContainer {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    height: max-content;
}

.workout {
    cursor: pointer;
    width: 100%;
    padding: 1.5rem 2rem;
    border-radius: 6px;
    background-color: var(--workoutBackground);
    color: var(--boxFontColor);
    display: flex;
    gap: 1.5rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease-in-out;
    animation: drop .23s backwards;
    position: relative;
}

.workout i {
    font-size: 20px;
    color: var(--boxFontColor);
    font-weight: 900;
    position: absolute;
    right: 1.5rem;
    bottom: 3rem;
}

.rotateArrow {
    transform: rotate(180deg);
}

.tagsWrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
}

.workoutsContainer:has(.workout:hover) .workout:not(.workout:hover) {
    transform: scale(.98);
    opacity: 0.4;
}

.tag {
    height: fit-content;
    width: auto;
    background: var(--tagColor);
    color: var(--boxFontColor);
    font-weight: 500;
    padding: .5rem;
    border-radius: 8px;
}

.exerciseList li {
    padding: 1rem;
    border-radius: 8px;
    transition: all .2s ease-in-out;
}

.exerciseList li:hover {
    background-color: #ffffff5b;
}

/* Workout Section */

.workoutSection {
    display: flex;
    width: 100%;
    height: 0;
    opacity: 0;
    flex-direction: column;
    transition: all 0.23s ease-in-out;
    transition: padding 0.1s;
    transition: overflow 0.1s;
    overflow: hidden;
}

.workoutSection ol {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exercise h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.description {
    margin: 1rem .5rem;
}

/* Animations */

@keyframes drop {
    0% {
        transform: translateY(-15px);
        opacity: 0;
    }

}

/* Media Queries */

@media(min-width:543px) {
    header {
        justify-content: space-around;
    }

    .title2 {
        justify-content: space-around;
    }

    .workout {
        margin-left: 4rem;
        width: 60%;
    }
}

/* active */

.workout.active .workoutSection {
    height: 100%;
    opacity: 1;
    padding: 1.2rem;
    transition: all .2s ease-in-out;
    transition: padding 0s ease-in-out;
    overflow: visible;
}

.workout.active i {
    transform: rotate(180deg);
    transition: all 0.5s ease-in-out;

}

/* Modal */

#errorMessage {
    color: rgb(255, 30, 30);
    font-weight: 600;
}

.hide {
    display: none;
}

.modal,
.newExerciseModal {
    width: 90%;
    min-height: max-content;
    background-color: var(--workoutBackground);
    color: var(--boxFontColor);
    box-shadow: 0 10px 10px 8px rgba(0, 0, 0, 0.24);
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 6px;
    padding: 4rem 2rem;
}

.modalTitle {
    font-size: 2.8rem;
}

.modalWrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#closeModal,
#closeNewExerciseModalBtn {
    position: absolute;
    right: 0;
    top: 0;
    margin: 1rem;
}

.modal input,
.newExerciseModal input {
    cursor: pointer;
    outline: none;
    border: none;
    border-radius: 8px;
    height: 4rem;
    width: 100%;
    padding: .2rem 1.5rem;
    color: var(--boxFontColor);
    background: #0000001f;
    appearance: none;
}

.modal input:focus,
.newExerciseModal input:focus {
    outline: 1px solid var(--boxFontColor);
}

.modal button,
.newExerciseModal button {
    cursor: pointer;
    outline: none;
    border: none;
    border-radius: 6px;
    height: 4rem;
    width: 100%;
    padding: 1rem 2rem;
    background-color: var(--Background);
    color: var(--fontColor);
    appearance: none;
    transition: all .3s ease-in-out;
}

.modal button:hover,
.newExerciseModal button:hover {
    background-color: var(--tagColor);
    color: var(--fontColor);
}


.inputWrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width:544px) {
    .modal {
        width: 40%;
    }
}