@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');
* {
    margin: 0;
    border: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    background-image: url("../imgs/app-bg.webp");
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    flex-direction: column;
    font-family: "Ubuntu", sans-serif;
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.alert {
    background-color: #f8d7da;
    padding: 10px;
    align-items: center;
    border-radius: 5px;
    border-radius: 2px solid #721c24;
    color: #721c24;
    font-size: 12px;
    max-width: 60%;
    text-justify: justify;
}

.dashboard-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 90%;
    height: 90%;
    border-radius: 15px;
    background-color: #fff;
    padding-top: 4px;
}

.dashboard-section > .dashboard-header {
    display: flex;
    flex-direction: column;
    list-style: none;
    align-items: center;
    width: 100%;
}

.dashboard-header > .dashboard-nav {
    display: flex;
    flex-direction: row;
    list-style: none;
    gap: 20px;
    align-items: center;
    justify-self: center;
}
.dashboard-header > .dashboard-nav > li {
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 18px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}
.dashboard-header > .dashboard-nav > li:hover {
    background-color: #f0f0f0;
    cursor: pointer;
}

#logout {
    padding: 10px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 10px;
    align-self: flex-end;
    margin-top: 3px;
    margin-right: 40px;
    cursor: pointer;
}

#logout:active, #logout:hover {
    padding: 10px;
    background-color: darkred;
    color: white;
    border: none;
    border-radius: 10px;
    align-self: flex-end;
    margin-top: 3px;
    margin-right: 40px;
    cursor: pointer;
    transition: background-color 0.1s ease-in;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 90%;
    background-color: #f0f0f0;
}

.homepage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.homepage > p {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    text-align: justify;
    max-width: 50%;
}

.homepage > .homepage-lastnote {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-radius: 15px;
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    max-width: 220px;
    min-width: 200px;
    max-height: 250px;
    min-height: 200px;
}

.homepage > .homepage-lastnote-actions {
    display: flex;
    flex-direction: row;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.note-date {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

#edit-note, #edit-lastnote {
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

#delete-note, #delete-lastnote {
    padding: 10px;
    background-color: red;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.dashboard-container > .notes-error {
    text-align: center;
    width: 60%;
    margin-bottom: 20px;
}

.notes {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 90%;
}

.notes-options {
    align-self: flex-end;
    margin-right: 50px;
    margin-bottom: 10px;
}

.note-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

#add-note {
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.notes-list {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 90%;
    flex-wrap: wrap;
    border-top: 1px solid black;
    padding: 10px;
    gap: 20px;
    overflow: hidden;
    overflow-y: scroll;
}

.note-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-radius: 15px;
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    max-width: 220px;
    min-width: 200px;
    max-height: 250px;  
    min-height: 200px;
}

.note-content, .note-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    max-height: 4.5em;
    line-height: 1.5em;
    word-wrap: break-word; 
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.add-note, .edit-note {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 90%;
}
#add-note-form, #edit-note-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    border: 1px solid black;
    padding: 20px;
    border-radius: 15px;
    background-color: #fff;
}

#add-note-form > #content, #edit-note-form > #content {
    resize: none;
    width: 271px;
    height: 111px;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#add-note-form > #title, #edit-note-form > #title {
    width: 271px;
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#add-note-form > #add-note-submit {
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

#edit-note-form > #edit-note-submit {
    padding: 10px;
    background-color: orangered;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}


footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 5%;
    background-color: #333;
    color: #fff;
    font-size: 14px;
}

@media (max-width: 768px) {
    #add-note-form, #edit-note-form, .note-item, .homepage-lastnote {
        transform: scale(0.8);
    }
    .homepage {
        transform: scale(0.9);
    }

    #logout {
        margin-top: 20px;
    }

}