﻿a {
    color: #255c8b
}

.header {
    background-color: #203864;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    width: 100%;
    margin: 0;
    padding: 10px 20px;
    box-sizing: border-box;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.header-logo {
    height: 60px;
    width: auto;
    flex-shrink: 0;
}

#logotxt {
    font-family: Calibri;
    font-size: 35px !important;
    font-weight: bold;
    color: white !important;
    text-decoration: none;
    line-height: 1.2;
    margin: 0;
    white-space: normal;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#usertxt {
    color: white;
    padding-left: 10px;
}

#sidebar {
    background: #203864;
    position: absolute;
    transition: all 0.5s ease;
    border: solid;
    z-index: 1000;
    height: 100vh;
    width: 250px;
}

    #sidebar ul li a {
        display: block;
        color: #203864;
        font-size: 16px;
        position: relative;
        text-decoration: none;
    }

#wrapper {
    display: block;
    width: 100%;
}

#content {
    min-height: 100vh;
    position: absolute;
    right: 0;
    width: calc(100% - 299px);
}

.no-sidebar #sidebar {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.5s linear;
}

.no-sidebar #content {
    transition: all .25s ease;
    width: 100%;
    opacity: 1;
}

.menuBtn {
    width: 230px;
    height: auto;
    margin-bottom: 10px;
    text-wrap: auto;
}

.addPageBtn {
    width: 230px;
    height: 35px;
    margin-bottom: 10px;
    text-wrap: auto;
    background-color: transparent;
    border: solid 1px;
    border-color: lightgray;
}

.admnBtn {
    width: 230px;
    height: auto;
    margin-bottom: 10px;
    text-wrap: auto;
}

.menuBtn:hover {
    box-shadow: 0 0 15px #ccc;
}

.topMenu:hover {
    box-shadow: 0 0 15px #ccc;
}

.addPageBtn:hover {
    box-shadow: 0 0 15px #ccc;
}

.topBar {
    background-color: lightgray;
    border: 3px solid;
    border-color: #203864;
    margin-left: 10px;
}

.topBarItems {
    font-size: 18px;
    color: #0064ac;
    background-color: #dddddd;
}

.has-search .form-control {
    padding-left: 2.375rem;
}

.has-search .form-control-feedback {
    position: absolute;
    z-index: 2;
    display: block;
    width: 2.375rem;
    height: 2.375rem;
    line-height: 2.375rem;
    text-align: center;
    pointer-events: none;
    color: #aaa;
    margin-top: 13px;
    padding-right: 10px;
}

.dt-layout-start {
    display: none;
}

.dt-layout-end {
    display: none;
}

.search-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

#searchbox {
    font-style: normal;
    font-family: Arial, FontAwesome, sans-serif;
    color: black;
    border-radius: 5px;
    border: none;
    height: 35px;
    padding-left: 10px;
    vertical-align: middle;
    box-sizing: border-box;
}

/*#searchTable {
    position: absolute;
    top: -5px;
    width: 357px !important;
    min-width: 250px;
    margin-top: 5px;
    background-color: white;
    color: black;
    border: 1px solid #203864;
    z-index: 1050;
    padding: 5px;
    box-shadow: -7px 5px 10px rgba(0, 0, 0, 0.15);
}*/

#searchTable {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100% !important; /* Allow it to match searchbox width */
    max-width: 100vw;
    box-sizing: border-box;
}

#searchTable_wrapper {
    position:absolute !important
}

#main.sidebar-expanded {
    margin-left: 250px;
}

@media (max-width: 992px) {
    .header {
        justify-content: center;
    }

    .header-left {
        justify-content: center;
        text-align: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
}
/* Media query targeting 200%-300% zoom levels (typical effective width < 768px) */
@media (max-width: 768px) {
    #main, #main.sidebar-expanded {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* Prevent header items from overlapping */
    .header {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .header-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #logotxt {
        /* Clamp font size dynamically between 1.2rem and 1.8rem */
        font-size: clamp(1.2rem, 4vw, 1.8rem) !important;
        text-align: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        width: 100%;
    }

    #searchbox {
        width: 100%;
    }

    /* Convert absolute search table dropdown to relative width */
    #searchTable {
        width: 100% !important;
        position: absolute;
        left: 0;
        top: 100%;
    }

    /* Transition sidebar from absolute float to full-width block */
    #sidebar {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
    }

        #sidebar ul li a, .menuBtn, .addPageBtn, .admnBtn {
            width: 100% !important; /* Allow menu items to take full width */
        }
}

@media screen and (max-width: 480px) {
    /* Stack header contents vertically */
    .header-left, .header-right {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    #logotxt {
        font-size: 1.5rem !important; /* Prevents overflow */
        text-align: center;
    }

    .header-logo {
        height: 40px; /* Scaling down fixed-height logos */
        align-self: center;
    }

    /* Stack sidebar inline instead of absolute overlay */
    #sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    /* Reset main content margins set by JS */
    #main {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* Make buttons full width for touch and narrow screens */
    .menuBtn, .addPageBtn, .admnBtn {
        width: 100%;
    }
}