/* Basic site styling */
body {
    font-family: sans-serif;
    margin: 0;
    line-height: 1.6;
    background-image: url('Fundo.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure body takes full viewport height */
    text-align: center; /* Center all text and inline elements */
}

.container {
    flex: 1; /* Allow container to grow and push footer down */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center block elements horizontally */
    justify-content: center; /* Center content vertically if space allows */
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

h1 {
    color: #5a5a5a;
}

p {
    margin-bottom: 15px;
}

/* Buttons container */
.buttons-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-add {
    background-color: #007bff;
}

.btn-add:hover {
    background-color: #0056b3;
}

.btn-view {
    background-color: #28a745;
}

.btn-view:hover {
    background-color: #218838;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
    text-align: left; /* Keep modal content text aligned left */
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

.note-input {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.save-button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.save-button:hover {
    background-color: #45a049;
}

#listaNotas {
    list-style: none;
    padding: 20px;
    max-width: none;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    transition: filter 0.3s ease;
}

#listaNotas li {
    width: 200px;
    height: 200px;
    padding: 15px;
    margin: 0;
    border-radius: 2px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transform: rotate(-2deg);
    transition: all 0.3s ease;
    border: none;
    white-space: pre-wrap;
    word-break: break-word;
}

#listaNotas li:nth-child(1),
#listaNotas li:nth-child(5),
#listaNotas li:nth-child(9),
#listaNotas li:nth-child(13) {
    background-color: #FFE5B4; /* Pêssego */
    color: #333;
    transform: rotate(-3deg);
}

#listaNotas li:nth-child(2),
#listaNotas li:nth-child(6),
#listaNotas li:nth-child(10),
#listaNotas li:nth-child(14) {
    background-color: #FFFF99; /* Amarelo */
    color: #333;
    transform: rotate(2deg);
}

#listaNotas li:nth-child(3),
#listaNotas li:nth-child(7),
#listaNotas li:nth-child(11),
#listaNotas li:nth-child(15) {
    background-color: #FFB6C1; /* Rosa */
    color: #333;
    transform: rotate(-2deg);
}

#listaNotas li:nth-child(4),
#listaNotas li:nth-child(8),
#listaNotas li:nth-child(12),
#listaNotas li:nth-child(16) {
    background-color: #B0E0E6; /* Azul claro */
    color: #333;
    transform: rotate(3deg);
}

#listaNotas li:hover {
    transform: scale(1.05) rotate(0deg);
    box-shadow: 0 8px 12px rgba(0,0,0,0.3);
}

/* Notes background blur effect */
.notes-background {
    display: none;
    z-index: 10;
}

/* Notes view modal */
.notes-view-modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.3s ease;
}

.notes-view-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-view-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #6c757d;
    padding: 8px 16px;
    font-size: 14px;
}

.back-button:hover {
    background-color: #5a6268;
}

.notes-list-view {
    list-style: none;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.notes-list-view li {
    width: 180px;
    height: 180px;
    padding: 15px;
    margin: 0;
    border-radius: 2px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transform: rotate(-2deg);
    transition: all 0.3s ease;
    border: none;
    white-space: pre-wrap;
    word-break: break-word;
}

.notes-list-view li:nth-child(1),
.notes-list-view li:nth-child(5),
.notes-list-view li:nth-child(9),
.notes-list-view li:nth-child(13) {
    background-color: #FFE5B4;
    color: #333;
    transform: rotate(-3deg);
}

.notes-list-view li:nth-child(2),
.notes-list-view li:nth-child(6),
.notes-list-view li:nth-child(10),
.notes-list-view li:nth-child(14) {
    background-color: #FFFF99;
    color: #333;
    transform: rotate(2deg);
}

.notes-list-view li:nth-child(3),
.notes-list-view li:nth-child(7),
.notes-list-view li:nth-child(11),
.notes-list-view li:nth-child(15) {
    background-color: #FFB6C1;
    color: #333;
    transform: rotate(-2deg);
}

.notes-list-view li:nth-child(4),
.notes-list-view li:nth-child(8),
.notes-list-view li:nth-child(12),
.notes-list-view li:nth-child(16) {
    background-color: #B0E0E6;
    color: #333;
    transform: rotate(3deg);
}

.notes-list-view li:hover {
    transform: scale(1.05) rotate(0deg);
    box-shadow: 0 8px 12px rgba(0,0,0,0.3);
    cursor: pointer;
}

/* Full note view modal */
.full-note-modal {
    display: none;
    position: fixed;
    z-index: 150;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    animation: fadeIn 0.3s ease;
}

.full-note-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-note-content {
    background-color: #fefefe;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.close-full-note {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    padding: 0;
}

.close-full-note:hover {
    color: black;
}

.full-note-text {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

footer {
    margin-top: auto; /* Push footer to the bottom */
    padding: 20px;
    background-color: #e0e0e0;
    color: #5a5a5a;
    text-align: center;
    width: 100%;
}