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

:root {
    --fundo: rgb(245, 224, 228);
    --rosa-claro: pink;
    --rosa-escuro: palevioletred;
    --texto: black;
    --input-box: rgb(255, 248, 250);
    --placeholder: rgb(196, 191, 191);
}

.dark-mode {
    --fundo: #2c2544;
    --rosa-claro: #f495b7;
    --rosa-escuro: #cd4583;
    --texto: white;
    --input-box: palevioletred;
    --placeholder: pink;
}

body {
    font-size: 16px;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
}

#container {
    width: 100%;
    min-height: 100vh;
    height: auto;
    background-color: var(--fundo);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem 0;
}

#titles {
    text-align: center;
    display: flex;
    flex-direction: column;
    width: 80%;
    color: var(--texto);
}

.title-theme {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.title-theme #btn-theme {
    position: absolute;
    top: 0;
    right: 0;
}

#user-inputs {
    width: 80%;
    height: 30%;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

#form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--texto);
}

#form input, #form textarea {
    margin-bottom: 0.5rem;
    padding: 0.25rem;
    border: 0.1rem solid var(--rosa-escuro);
    border-radius: 0.5rem;
    resize: none;
    background-color: var(--input-box);
}

#form input::placeholder, #form textarea::placeholder {
    color: var(--placeholder);
    font-style: italic;
}

input[type="radio"], input[type="checkbox"] {
  accent-color: var(--rosa-escuro);
}

input[type="radio"]:hover, input[type="checkbox"]:hover {
  cursor: pointer;
}

#form textarea {
    scrollbar-width: thin;
    scrollbar-color: var(--rosa-escuro) var(--rosa-claro);
}

#form button {
    width: 7rem;
    border: 0.1rem solid var(--rosa-claro);
    transition: all .1s ease-in-out;
}

#form button:hover {
    background-color: var(--rosa-claro);
    color: var(--texto);
    transition: all .1s ease-in-out;
}

.form-buttons {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.cards-container {
    display: flex;
    justify-content: center;
    height: 70%;
    width: 90%;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
}

.card-front, .card-back {
    width: 15rem;
    height: 10.5rem;
    background-color: var(--rosa-claro);
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    gap: 0.5rem;
    box-shadow: 0.15rem 0.15rem rgba(216, 112, 147, 0.5);
    transition: background-color .3s ease-in-out;
}

.card-front:hover, .card-back:hover {
    background-color: rgb(252, 178, 190);
}

.card-front .left {
    width: 50%;
    height: 100%;
}

.card-front .left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-front .right {
    display: flex;
    flex-direction: column;
    width: 50%;
    height: 100%;
    gap: 0.5rem;
}

.card-front .right .title-and-edit {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.right .title-and-edit button.edit,
.title-theme button#btn-theme {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--rosa-escuro);
    transition: all .1s ease-in-out;
}

.right .title-and-edit button.edit:hover,
.title-theme button#btn-theme:hover {
    color: var(--texto);
}

.card-front .right h3,
.card-back h3 {
    font-size: 1rem;
    max-height: 4rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.card-front .right p,
.card-back p {
    font-size: 0.75rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--rosa-escuro) var(--rosa-claro);
    text-align: justify;
    padding-right: 0.2rem;
    word-break: break-all;
}

.card-back p {
    flex: 1;
}

.card-back {
    display: flex;
    flex-direction: column;
    background-color: var(--rosa-claro);
    width: 100%;
    overflow: hidden;
}

.read-status {
    display: flex;
    gap: 0.5rem;
    line-height: 0.9;
}

p.status {
    padding: 0.1rem 0.4rem;
    background-color: var(--rosa-escuro);
    color: white;
    font-size: 0.7rem;
    border-radius: 0.4rem;
    text-align: center;
    max-height: 1rem;
    overflow: hidden;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.buttons button, #form button, 
button.go-back, .filter-btns button {
    padding: 0.1rem 0.5rem;
    border: 0.1rem solid var(--rosa-escuro);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all .1s ease-in-out;
}

.filter-btns {
    width: 80%;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.link-read a {
    text-decoration: none;
    color: black;
    transition: all .1s ease-in-out;
}

button:hover, .link-read a:hover {
    background-color: var(--rosa-escuro);
    color: white;
}

.hidden-card, .hidden-message {
    display: none;
}

.active {
    background-color: var(--rosa-escuro);
    color: white;
}

#empty-message {
    text-align: center;
    margin-top: 1rem;
    color: #888;
    font-style: italic;
}

/* toda a lógica do flip aqui! */
.flip {
    width: 15rem;
    height: 10.5rem;
    position: relative;
    perspective: 62.5rem;
}

.flip .card-front,
.flip .card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 15rem;
    height: 10.5rem;
    backface-visibility: hidden;
    transition: transform .6s ease;
    border-radius: 1rem;
}

.flip .card-front {
    transform: rotateY(0deg);
}

.flip .card-back {
    transform: rotateY(180deg);
}

.flip.flipped .card-front {
    transform: rotateY(-180deg);
}

.flip.flipped .card-back {
    transform: rotateY(0deg);
}

html, body, body * {
    transition: all .2s ease;
}
