@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Khmer:wght@400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans Khmer', 'Segoe UI', Tahoma, Arial, sans-serif;
    line-height: 1.5;
}

body,
button,
input,
textarea,
select,
h1,
h2,
h3,
p,
a {
    font-family: 'Noto Sans Khmer', 'Segoe UI', Tahoma, Arial, sans-serif;
}

.banner {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin: 0 0 1em 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1920px;
    width: 90%;
}

.navbar .navLinks button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    font-size: 1em;
    cursor: pointer;
}

.navbar .navLinks button:hover {
    background-color: #0056b3;
}

.bannerContainer {
    max-width: 1920px;
    height: 384px;
    width: 90%;
    background: url(image/595674424_1152675927068072_2433275573075965072_n.jpg) no-repeat center /cover;
}

.mainBody {
    display: flex;
    justify-content: center;
}

.contentBody {

    max-width: 1920px;
    width: 90%;
    display: flex;
    flex-direction: row;
    position: relative;
}

.contentBody::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(image/backgound.png) no-repeat center /cover;
    z-index: -1;
    filter: blur(10px);
}

.mainContent {
    width: 75%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sideBar {
    width: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.seeLevelList {
    margin-top: .5em;
    width: 100%;
    display: flex;
    justify-content: center;
}

.seeLevelList button {
    width: 99%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

.addBookButton {
    padding: 10px;
    background-color: #007bff;
    width: 100%;
    color: white;
    border: none;
    cursor: pointer;
}

.levelHeader {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #f5f5f5;
}

.levelHeader h1 {
    font-size: 1.7em;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #333;
}

.addBookButton:hover {
    background-color: #0056b3;
}

.seeLevelList button:hover {
    background-color: #0056b3;
}

.subjectSelect {
    min-height: 10%;
    height: auto;
    width: 100%;
    display: none;
}

.displayMajorList {
    display: block;
}

.contentDisplay {
    width: 100%;
    height: 75%;
}

.showResult {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    width: 100%;
    height: 100%;
    max-height: none;
    left: 0;
    top: 0;
    transform: none;
    overflow-y: auto;
    padding: 20px;
    pointer-events: none;
}

.showResult.has-content {
    display: flex;
    pointer-events: auto;
}

.statusMessage {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 5px;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.statusMessage.hide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.disableInteraction {
    pointer-events: none;
    opacity: 0.5;
}

.button button {
    padding: 10px;
    background-color: #007bff;
    width: 100%;
    color: white;
    border: none;
    cursor: pointer;
}

.button button:hover {
    background-color: #0056b3;
}

.contentTable {
    width: 100%;
    border-collapse: collapse;
}

.contentTable th,
.contentTable td {
    border: 1px solid #ddd;
    padding: 8px;
}

.contentTable th,
.contentTable td {
    background-color: #f2f2f2;
    text-align: left;
}

.deletecontent,
.editcontent {
    color: #007bff;
    text-decoration: none;
    margin-right: 10px;
}

.deletecontent:hover,
.editcontent:hover {
    text-decoration: underline;
}

.footer {
    text-align: left;
    padding: 1em 0;
    width: 100%;
    bottom: 0;
}

.footer p {
    margin-left: 3em;
}

@media (max-width: 900px) {
    .navbar {
        width: 95%;
        flex-wrap: wrap;
        gap: 0.75em;
        justify-content: center;
    }

    .navLinks {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5em;
    }

    .bannerContainer {
        width: 95%;
        height: 260px;
    }

    .contentBody {
        flex-direction: column;
        width: 95%;
    }

    .sideBar,
    .mainContent {
        width: 100%;
    }

    .mainContent {
        height: auto;
    }

    .showResult {
        width: 95vw;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    .banner {
        margin-bottom: 0.75em;
    }

    .navbar {
        width: 100%;
        padding: 0.75em 1em;
        gap: 0.5em;
    }

    .logo {
        flex-direction: column !important;
        text-align: center;
        gap: 0.25em !important;
    }

    .logo h1 {
        font-size: 1.05rem;
    }

    .logo img {
        width: 38px !important;
    }

    .navLinks {
        width: 100%;
    }

    .navLinks button,
    .seeLevelList button,
    .addBookButton,
    .button button,
    .contact-button {
        width: 100%;
        padding: 0.75em;
        font-size: 0.95rem;
    }

    .bannerContainer {
        width: 100%;
        height: 160px;
        border-radius: 0;
    }

    .contentBody {
        width: 100%;
        gap: 0.5em;
    }

    .sideBar {
        gap: 0.4em;
    }

    .levelHeader {
        padding: 0.5em 0;
    }

    .levelHeader h1 {
        font-size: 1.1rem;
    }

    .contact {
        width: 100% !important;
        margin: 0.5em 0 0 !important;
        padding: 0.75em !important;
    }

    .contentDisplay {
        height: auto;
        padding: 0 0.5em;
    }

    .contentTable {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .filtercontainer {
        grid-template-columns: 1fr;
        gap: 0.75em;
        padding: 0;
    }

    .pill {
        width: 100%;
        padding: 12px 16px;
        text-align: center;
        white-space: normal;
    }

    .bookListContainer {
        padding: 0.75em !important;
    }

    .bookList {
        grid-template-columns: 1fr !important;
        gap: 0.75em !important;
    }

    .bookItem {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }

    .bookCover {
        margin-right: 0;
        margin-bottom: 0;
        width: 90px;
        height: auto;
        order: 1;
    }

    .bookInfomation {
        flex: 1;
        order: 2;
    }

    .containerBook {
        width: 100% !important;
        padding: 15px !important;
    }

    .listContainer {
        flex-direction: column;
        gap: 15px;
    }

    .bookResource {
        display: flex;
        flex-direction: column;
        gap: 0.75em;
        margin-top: 20px;
    }

    .bookResource a,
    .bookResource button,
    .bookResource a button {
        width: 100%;
    }

    .showResult.has-content {
        padding: 10px;
        align-items: flex-start;
    }

    .showResult>* {
        width: 100%;
        max-width: 100%;
    }

    .statusMessage {
        width: 90vw;
        max-width: 320px;
        padding: 1em;
    }

    .footer {
        text-align: center;
        padding: 0.75em 0;
    }

    .footer p {
        margin-left: 0;
        padding: 0 1em;
        font-size: 0.85rem;
    }
}