@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');

/* === Global === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #fff;
}

/* === Reusable Classes === */
.btn {
    cursor: pointer;
    outline: none;  
    border: none;  
    transition: ease 0.2s;
}

/* === Buttons === */
.btn-add {
    align-self: flex-end;
    margin-left: 50%;
    margin-bottom: 3%;
    padding: 10px 20px;
    color: #fff;
    background-color: #0978ed;
}

.btn-add:hover {
    background-color: #0264cc;
}

.btn-clear {
    align-self: flex-end;
    padding: 10px 20px;
    left: 30%;
    top: 90%;
    background-color: #e80e36;
    color: #fff;
}

.btn-clear:hover {
    background-color: #d1042a;
}

.btn-addCards {
    width: 80%;
    padding: 16px;
    color: #fff;
    background-color: #0978ed;
}

.btn-addCards:hover {
    background-color: #0264cc;   
}

.btn-showAnswer {
    padding: 10px 40px;
    text-align: center;
    color: #fff;
    background-color: #0978ed;
    width: 30%;
    margin: 50px auto 0 auto;    
}

.btn-showAnswer:hover {
    background-color: #0264cc;    
}

/* === General Styling === */
.title {
    margin: 0 0 15px 0;
}

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

.card-container {
    width: 100%;
    height: 100vh;
    box-shadow: 0 4px 4px 0 rgb(0 0 0 / 50%);
    display: flex;
    align-self: center;
    position: relative; 
}

.icon {
    position: absolute;
    top: 40%;
    cursor: pointer;
    transition: ease 0.2s;
    font-size: 20px;
    padding: 10px;
    z-index: 99;
}

.icon.hide {display: none;}

.icon:hover {transform: translate(-8px, 0);}

.icon-left {left: 25%;}

.icon-right {right: 25%;}

.total-cards {
    left: 49%;
    top: 80%;
    position: absolute;
}

.add-card-container {
    position: fixed;
    width: 100%;
    min-height: 100vh;
    background-color: rgba(0,0,0, 0.2);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.add-card-container.active {
    display: flex;
}

.add-card-content {
    width: 60%;
    height: 70vh;
    background-color: #fff;
    animation: addCardAnimate .6s;
    transition: ease-in;
}

.close-icon {
    margin-left: 95%;
    margin-top: 3%;
    font-size: 20px;
    cursor: pointer;
}

.form-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 60px;
}

.form-content label {
    margin: 0 0 8px 0;
}

.form-content input {
    display: block;
    width: 80%;
    padding: 8px 16px;
    line-height: 25px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 6px;
    -webkit-appearance: none;
    color: #99A3BA;
    border: 1px solid #CDD9ED;
    background: #fff;
    transition: border .3s ease;
    margin: 0 0 10px 0;
}

.form-content input::placeholder {
    color: #CBD1DC;
}

.form-content input:focus {
    outline: none;
    border-color: #275EFE;
}

.card {
    box-shadow: 0px 0px 5px 3px rgba(120,172,255,0.32);
    transition: ease 0.3s;
    width: 40%;
    height: 80vh;
    position: absolute;    
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    top: 5%;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    display: none; 
    animation: fade 0.4s ease;
}

.card.active {
    display: flex;
}

.card-question {
    margin: 0 0 40px 0;
    font-size: 24px;
    font-weight: 600;
}

.card-answer {
    margin: 40px 0 0 0;
    font-size: 18px;
    opacity: 0;
    transition: linear 0.2s;
}

.card-answer.active {
    opacity: 1;
}

.card-hr {
    width: 80%;
    margin: 0 auto;
}

@keyframes fade{
    0% {
        opacity: 0; 
    }
    100% {
        opacity: 1;
        transform: opacity linear;
    }
}

@keyframes addCardAnimate {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/*** Media Queries ***/
@media(max-width: 900px) {
    .card {
        width: 80%;
    }
}

@media(max-width: 700px) {
    .card {
        width: 90%;
    }
    .container {
        flex-direction: column;
    }

    .card-container {
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        min-height: 100vh;
    }

    .icon-left {left: 4%;}

    .icon-right {right: 4%;}

    .form-content {
        padding: 0 20px;
    }

    .btn-add {
        width: 90%;
        margin: 0 auto;   
    }

    .btn-clear {
        position: static;
        width: 90%;
        margin: 0 auto 8px auto;
    }

    .add-card-content,
    .form-content input,
    .btn-addCards {
        width: 90%;
    }

    .btn-showAnswer {
        width: 50%;
    }

    .close-icon {
        margin-left: 90%;
    }
}

