:root {
    --postIt-background-color: #19bd78;
    --saveAndDel-hover-color: #86b9a4;
}

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

body {
    /* add background image */
    background-color: #f5f5f5;
    background-image: url("/images/corcho.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    margin: 30px;
}

#postItContainer {
    display: grid;
    width: 100%;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    grid-gap: 20px;
}

.postIt {
    margin: 0 auto;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
    height: 400px;
    width: 400px;
    padding: 5px;
    rotate: 0deg;
}

.postIt h6 {
    font-size: 20px;
    font-weight: 500;
    padding: 15px 15px 0 15px;
    margin-top: 20px;
}

.fa-solid.fa-gear {
    position: absolute;
    top: 50px;
    right: 15px;
}

.postIt p {
    padding: 0 15px;
    width: 390px;
    height: 300px;
    overflow: hidden;
    word-wrap: break-word;
    font-size: 17px;
}

#modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
}

#addPostIt {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

#addPostIt .postIt {
    background-color: var(--postIt-background-color);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
}

#title,
#editTitle {
    font-size: 20px;
    font-weight: 500;
    border: none;
    background-color: transparent;
    width: 250px;
}

#title:focus,
#editTitle:focus {
    outline: none;
}

.saveDelBtns {
    display: flex;
    gap: 20px;
    justify-content: end;
}   

#text,
#editText {
    width: 100%;
    height: 320px;
    border: none;
    background-color: transparent;
    font-size: 17px;
    padding: 0 15px;
    resize: none;
}

#text:focus,
#editText:focus {
    outline: none;
}

.edit {
    transform: translate(-50%, -50%) rotate(90deg);
    position: absolute;
    top: 25px;
    right: 0;
    border: none;
    background-color: transparent;
    font-size: 30px;
    cursor: pointer;
}


.postItTitle {
    display: flex;
    justify-content: center;
}

#addPostIt {
    display: none;
}

#editPostIt {
    display: none;
}

.addNewPostIt {
    height: 400px;
    width: 400px;
    cursor: pointer;
    margin: 0 auto;
    background-color: transparent;
    border-radius: 50px;
}

.addNewPostIt:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.747);
}

.addNewPostIt:focus {
    outline: none;
}

.fa-solid.fa-plus {
    font-size: 100px;
    color: rgba(0, 0, 0, 0.589);
}

.fa-solid.fa-gear, .fa-solid.fa-check, .fa-solid.fa-xmark, .fa-solid.fa-trash {
    font-size: 25px;
    color: rgba(0, 0, 0, 0.315);
    cursor: pointer;
}

.fa-solid.fa-gear:hover, .fa-solid.fa-check:hover, .fa-solid.fa-xmark:hover, .fa-solid.fa-trash:hover {
    color: rgba(0, 0, 0, 0.8);
}

.shake {
    animation: shake 0.5s;
    animation-iteration-count: 5s;
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(5deg);
    }

    50% {
        transform: rotate(0eg);
    }

    75% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.pin {
    background-image: radial-gradient(rgba(255, 0, 0, 0.76) 50%, black 100%);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    position: absolute;
    top: 5px;
    left: 185px;
    z-index: 1;
    cursor: pointer;
}

@media  (max-width: 464px) {
    #postItContainer {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        grid-gap: 20px;

    }

    .postIt {
        width: 300px !important;
        height: 300px !important;
    }


    .postIt h6 {
        font-size: 15px !important;
        margin-top: 10px !important;
        padding: 10px 0 15px 15px !important;
        width: 240px !important;
    }

    .postIt p {
        font-size: 12px !important;
        width: 290px !important;
        height: 220px !important;   
    }

    .addNewPostIt {
        height: 300px !important;
        width: 300px !important;
    }

    .pin {
        width: 15px !important;
        height: 15px !important;
        left: 142.5px !important;
    }

    .fa-solid.fa-plus {
        font-size: 50px !important;
        padding-left: 3px !important;
    }
    
    .fa-solid.fa-gear {
        position: absolute;
        top: 35px;
        right: 15px;
    }

    .fa-solid.fa-gear, .fa-solid.fa-check, .fa-solid.fa-xmark, .fa-solid.fa-trash {
        font-size: 20px !important;
    }

    .header {
        padding: 15px !important;
        gap: 10px !important;
    }

    .saveDelBtns {
        gap: 10px !important;
        margin-right: 4px !important;
    }

    #title, #editTitle {
        font-size: 20px !important;
        width: 100px !important;
    }

    #text, #editText {
        font-size: 15px !important;
        padding: 15px !important;
        height: 260px !important;
        padding-top: 0px !important;
    }
}


@media (max-width: 358px) {
    #postItContainer {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        grid-gap: 20px;
    }

    .postIt {
        width: 250px !important;
        height: 250px !important;
    }

    .postIt h6 {
        font-size: 12px !important;
        margin-top: 10px !important;
        padding: 5px 10px 0 10px !important;
        width: 210px !important;
    }

    .postIt p {
        font-size: 12px !important;
        width: 240px !important;
        height: 180px !important;   
        padding: 0 10px !important;
    }

    .addNewPostIt {
        height: 250px !important;
        width: 250px !important;
    }

    .pin {
        width: 10px !important;
        height: 10px !important;
        left: 120px !important;
    }

    .fa-solid.fa-plus {
        font-size: 40px !important;
        padding-left: 3px !important;
    }

    .fa-solid.fa-gear {
        position: absolute;
        top: 27px;
        right: 17px;
    }

    .fa-solid.fa-gear, .fa-solid.fa-check, .fa-solid.fa-xmark, .fa-solid.fa-trash {
        font-size: 15px !important;
    }

    .header {
        padding: 10px !important;
        gap: 10px !important;
    }

    .saveDelBtns {
        gap: 10px !important;
        margin-right: 7px !important;
    }

    #title, #editTitle {
        font-size: 17px !important;
        width: 160px !important;
    }

    #text, #editText {
        font-size: 12px !important;
        padding: 10px !important;
        height: 210px !important;
        padding-top: 0px !important;
    }
}

@media (max-width: 309px) {
    #postItContainer {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-gap: 20px;
    }

    .postIt {
        width: 200px !important;
        height: 200px !important;
    }

    .postIt h6 {
        font-size: 11px !important;
        margin-top: 10px !important;
        padding: 5px 5px 0 5px;
        width: 170px !important;

    }

    .postIt p {
        font-size: 9.3px !important;
        width: 190px !important;
        height: 145px !important;
        padding: 0 5px !important;
    }

    .addNewPostIt {
        height: 200px !important;
        width: 200px !important;
    }

    .pin {
        width: 7px !important;
        height: 7px !important;
        left: 97.5px !important;
    }

    .fa-solid.fa-plus {
        font-size: 30px !important;
        padding-left: 3px !important;
    }

    .fa-solid.fa-gear {
        position: absolute;
        top: 27px;
        right: 10px;
    }

    .fa-solid.fa-gear, .fa-solid.fa-check, .fa-solid.fa-xmark, .fa-solid.fa-trash {
        font-size: 10px !important;
    }

    .header {
        padding: 5px !important;
        gap: 10px !important;
    }

    .saveDelBtns {
        gap: 10px !important;
        margin-right: 4px !important;
    }

    #title, #editTitle {
        font-size: 10px !important;
    }

    #text, #editText {
        font-size: 10px !important;
        padding: 5px !important;
        height: 170px !important;
        padding-top: 0px !important;
    }
}