@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700');  /* Import Google Fonts */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');  /* Import Font Awesome */
@import url('color.css');   /* Import color.css */
@import url('book.css');  /* Import layout.css */

* {
  box-sizing: border-box;
}

/* Main layout */
body {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    max-width: 1800px;
    margin-top: 260px;
    margin-left: 50px;
    padding: 0 20px;
}

.static-div {
    position: fixed; /* Set position to fixed */
    top: 0; /* Align to the top of the viewport */
    left: 0; /* Align to the left of the viewport */
    width: 100%; /* Take up full width */
    display: flex;
    flex-direction: column;
    justify-items: center;
    color: #484D6D; /* Text color */
    background-color: #EFE9F4; /* Background color */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Add shadow for depth */
    z-index: 999; /* Ensure the div stays on top of other content */
    transition: opacity 3s ease-in-out; /* Add transition effect */
    opacity: 1; /* Initially visible */
}



.logoContainer,
.greet {
    transition: opacity 1s ease-in-out;
    opacity: 1;
}

.logoContainer.hidden,
.greet.hidden {
    opacity: 0;
    pointer-events: none;
}

.logoContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    padding: 0;
}

.logo {
    padding-right: 5px;
    margin: 0;
}

.username {
    font-size: 20px;
    font-weight: 500;
    font-style: italic;
    color: var(--info);
}

.greet {
    margin: 0;
    line-height: 2px;
    padding: 0;
    text-align: center;
    
}

.manageBook {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
}

.manageItem {
    display: flex;
    align-items: center;
    justify-content: center;

}

.addForm {
    display: flex;
    margin: 20px;
    padding: 0 20px;
    /* border: green 1px solid; */
}

.addItem {
    margin: 20px;
    padding: 0 10px;
    /* border: green 1px solid; */
}

/* Buttons */
button {
    margin: 5px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background-color: var(--secondary);
    color: white;
    transition: background-color 0.5s ease-in-out, transform 0.1s ease-in-out;
}

button:active {
    transform: scale(0.95);
}

form {
    margin-bottom: 20px;
}

label {
    margin-right: 10px;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

input[type="file"] {
    margin-bottom: 10px;
}

form[action="updateBook"] {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

#logoutBtn {
    background-color: var(--tertiary);
}

#logoutBtn:hover {
    background-color: darkred;
}

#logoutBtn::after {
    content: "\f08b";
    font-family: "Font Awesome 5 Free";
    font-weight: 800;
    font-size: 12px;
    margin-left: 10px;
}   

.searchForm {
    display: flex;
    min-width: 450px;
    padding-top: 5px;
    padding-bottom: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.searchForm input {
    text-align: center;
    font-size: 16px;
    width: 100%;
    margin-top: 5px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 20px;

}

.searchForm input:hover {
    background-color: #f9f9f9;
}

.searchBar {
    position: relative;
}


.searchBar .fa-search {
    position: absolute;
    top: 28px;
    left: 10px;
    transform: translateY(-50%);
    color: #ccc;
}

.searchResult {
    display: flex;
    padding: 5px;
    margin: 2px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #ffffff;

}

.searchResult span {
    margin-right: 20px;
}

.resultText {
    font-weight: 500;
    font-size: 20px;
    color: var(--primary);
}

.noResultText {
    font-weight: 500;
    font-size: 20px;
    color: var(--tertiary);
}

.resetBtn {
    background-color: var(--secondary);
    margin: 0 auto;
    padding: 8px 10px;
}

.resetBtn:hover {
    background-color: var(--secondary-dark);
}

.addBtn {
    margin-left: 0;
    background-color: var(--primary);
}

.addBtn:hover {
    background-color: var(--primary-dark);
}

.addBtn::after {
    content: "\f067";
    font-family: "Font Awesome 5 Free";
    font-weight: 800;
    font-size: 12px;
    margin-left: 9px;
}

.manageBtn::after {
    content: "\f0c9";
    font-family: "Font Awesome 5 Free";
    font-weight: 800;
    font-size: 12px;
    margin-left: 10px;
    
}

.manageBtn:hover {
    background-color: var(--secondary-dark);
}

.deleteBtn {
    background-color: red;
}

.deleteBtn:hover {
    background-color: darkred;
}

.updateBtn {
    margin: 0; /* Remove default margin */
}

.updateBtn:hover {
    background-color: var(--secondary-dark);
}

.cancelBtn {
    background-color: var(--tertiary);
}

.cancelBtn:hover {
    background-color: darkred;
}

.infinite-scroll-trigger {
    height: 10px; /* Adjust the height of the trigger element */
}

/* Media Queries for Responsive Design */
@media (max-width: 780px) {
    * {
        font-size: 12px;
    }

    input {
        font-size: 16px;
    }

    body {
        margin-top: 240px;
        margin-left: 20px;
        padding: 0 10px;
    }

    .logoContainer h1 {
        font-size: 20px;
    }

    .manageItem button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .searchForm input {
        width: 450px;
        font-size: 16px;
    }

    .searchBar .fa-search{
        top: 26px;
        font-size: 12px;
    }

    .resultText {
        font-weight: 400;
        font-size: 12px;
    }
    
    .noResultText {
        font-weight: 400;
        font-size: 12px;
    }

    .bookCover {
        width: 100px;
    }

    .username {
        font-size: 16px;
    }

    .resetBtn {
        padding: 5px 10px;
    }

    .addForm {
        margin: 10px;
        padding: 0 8px;
    }

    .addItem {
        width: 200px;
        font-size: 12px;
    }

    .addItem button {
        padding: 6px 10px;
        margin: 0;
    }

    input.fileInput {
        font-size: 12px;
    }
}

@media (max-width: 500px) {
    .searchBar {
        width: 500px;
    }

    .searchForm input {
        width: 300px;
        right: 200px;
    }

    .searchBar .fa-search {
        left: 110px;
    }

    .addForm {
        justify-content: center;
        padding: 0 5px;
        width: 450px;
        margin-left: 20px;
    }

    .addItem {
        margin: 8px;
        padding: 0 5px;
        width: 160px;
    }

    .addItem button {
        padding: 5px 8px;
        margin: 0;
        font-size: 12px;
    }
}