/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Grid Container */
body {
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
        "main-header"
        "sub-header1"
        "sub-header2"
        "map-section";
    height: 100vh;
    /* Full viewport height */
    font-family: 'Source Sans Pro', sans-serif;
    background-color: #f4f4f4;
    font-size: 1rem;
}

.container {
    display: grid;
    grid-template-areas:
        "about-section";
    height: 80vh;
    /* Full viewport height */
}

section.map-section {
    grid-area: map-section;
}

.about-section {
    grid-area: about-section;
    margin-top: 20px;
}

/* Grid Items */
header {
    font-family: Helvetica, sans-serif;
    align-items: center;
    display: flex;
    position: relative;
    overflow: hidden;
    z-index: 99;
}

header.main-header {
    grid-area: main-header;
    background-color: #012169;
    color: white;
}

header.sub-header {
    color: #494949;
    font-size: 1rem;
}

header.sub-header1 {
    grid-area: sub-header1;
    background-color: rgb(193, 220, 234)
}

header.sub-header2 {
    grid-area: sub-header2;
    background-color: #e2eff9;
}

.main-header .title {
    display: flex;
    font-size: 1.48rem;
    font-weight: bold;
    color: #f2f2f2;
    letter-spacing: 2px;
    pointer-events: none;
    text-decoration: none;
    padding-right: .5rem;
}

header .item {
    float: left;
    align-items: center;
    color: #f2f2f2;
    text-decoration: none;
    font-size: 0.9rem;
    font-size-adjust: 0.58;

    /* Button Style Testing */
    margin: 1rem 0.2rem;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    transition: background-color 0.3s;
}

a.filter-item {
    float: left;
    font-size: 0.9rem;
}

.main-header .title .logo {
    padding-right: 10px;
}

.main-header .item:hover {
    background-color: #004997;
}

.main-header .item.active {
    background-color: #0071B6;

}

header .icon {
    display: none;
    height: auto;
    top: 25px
}

.responsive-iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
}

#about-section-subheader {
    color: #012169;
    margin: 2% 0;
    font-size: 1.3rem;
}

#dataSource-table {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

#dataSource-table,
#dataSource-table th,
#dataSource-table td {
    border: 1px solid #494949;
    border-collapse: collapse;
    line-height: 100%;
    padding: 1%;
    font-weight: 400;
}

#dataSource-table thead {
    background-color: #003366;
    color: #fff;
    text-align: center !important;
}

#dataSource-table th.source,
#dataSource-table th.maps {
    width: 20%;
}

#dataSource-table th.description,
#dataSource-table th.data-included {
    width: 30%;
}

#dataSource-table tbody th.data-included {
    text-align: left;
}

#dataSource-table th.data-included li {
    margin: 1% 0;
}

#dataSource-table th.source .hyperlink {
    word-break: normal !important;
}

section.about-section {
    width: 70%;
    margin: 20px auto;
    padding: 20px;
    line-height: 160%;
    color: #151515;
    background-color: #f4f4f4;
}

section.about-section .media {
    text-align: center;
    padding: 1rem;
}

.media p {
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

section.about-section h4 {
    text-align: left;
    padding: 1rem;
}

section.about-section img {
    width: 55%;
    height: auto;
}

section.about-section .horizontal-img {
    width: 45%;
}

section.about-section figcaption {
    font-size: 0.9rem;
    line-height: 100% !important;
    padding-bottom: 0.5rem;
}

a.hyperlink {
    color: #004e8c;
    word-break: break-all;
}

a.highlight {
    color: #ce1828;
}

hr {
    border-color: #efefef;
}

ul,
ol {
    padding-left: 32px;
}

#logoDiv {
    background-color: transparent !important;
    display: flex;
    position: absolute;
    right: 15px;
    bottom: 30px;
    z-index: 98;
}

#logoDiv img.logo {
    height: 30px;
}

footer {
    text-align: center;
    padding: 10px;

}

footer p {
    font-size: 0.85rem;
    line-height: 120%;
}

.filter-item {
    margin: 0.5%;
}

#MapFilterDiv {
    position: relative;
    background-color: white;
    color: black;
    padding: 8px;
    top: 0;
    height: 32px;
    width: 530px;
    bottom: 0;
    display: flex !important;
    /* add display: flex */
    align-items: center;
    /* align child elements vertically centered */
}

#InfoDiv {
    position: relative;
    padding: 4vh;
    width: 60vh;
    height: 41vh;
    overflow-y: scroll
}

#InfoDiv a:link {
    color: black;
}

#InfoDiv a:visited {
    color: #696969;
}

.searchbar {
    position: absolute;
    inline-size: 100%
}

#viewDiv {
    width: 100%;
    height: 100%;

}

/* FQHC Toggle Button */
#toggle-fqhc-btn {
    cursor: default;
}

#clear-fqhc,
#toggle-fqhc-btn {
    padding: 6px 13px;
    font-size: 0.8rem;
    color: #ffffff;
    background-color: #012169;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 16px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 13px;
    width: 13px;
    left: 2.5px;
    bottom: 1.4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #0071B6;
}

input:focus+.slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
    -webkit-transform: translateX(16px);
    -ms-transform: translateX(16px);
    transform: translateX(16px);
}

.slider.round {
    border-radius: 10px;
}

.slider.round:before {
    border-radius: 50%;
}

.video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
}

.caption-container {
    margin-top: 10px;
    text-align: left;
    width: 100%;
    /* Matches video container width */
}

.expandable-captions {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 100%;
    /* Matches video container width */
    font-size: 0.8rem;

}

.expanded {
    max-height: 300px;
    /* Adjust this value based on the content size */
    overflow-y: auto;
}

.toggle-button {
    background-color: #f4f4f4;
    border: none;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    /* Matches video container width */
}

.caption-container table {
    border-spacing: 10px;
    line-height: 140% !important;
}

.caption-container table td {
    vertical-align: top;
}

.caption-container table td:hover {
    background-color: #cbcbcb;
    cursor: pointer;
}

/* custom scrollbar */
.caption-container ::-webkit-scrollbar {
    width: 20px;
}

.caption-container ::-webkit-scrollbar-track {
    background-color: transparent;
}

.caption-container ::-webkit-scrollbar-thumb {
    background-color: #d7d7d7;
    border-radius: 20px;
    border: 6px solid transparent;
    background-clip: content-box;
}

.caption-container ::-webkit-scrollbar-thumb:hover {
    background-color: #cbcbcb;
}

#scrollButton {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

#scrollButton button {
    border: 1px solid #313131;
    color: #4b4b4b;
    background-color: #eeeeee;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 50%;
    height: 50px;
    border-radius: 50%;
    -moz-border-radius: 50%;
    -webkit-border-radius: 50%;
    width: 50px;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.2 ease;
    box-shadow: 0 4px 6px rgb(0, 0, 0, 0.1);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#scrollButton button span {
    font-size: 10px;
}

#scrollButton button:hover {
    transform: scale(1.1);
}

#scrollButton li {
    border-bottom: 1px solid #cacaca;
}

#scrollButton ul {
    list-style: none;
    border: 1px solid #c6c6c6;
    border-radius: 5px;
    position: absolute;
    font-size: 0.9rem;
    display: none;
    bottom: 55px;
    right: 5px;
    z-index: 1000;
    width: 200px;
    margin: 0;
    padding: 10px;
    background-color: #eeeeee;
}

#scrollButton ul li {
    padding: 5px 5px;
    cursor: pointer;
}

#scrollButton ul li:hover {
    background-color: #bdbdbd;
}

#scrollButton button {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}


/* Responsive Adjustments */
@media screen and (max-width: 900px) {
    body {
        grid-template-areas:
            "main-header"
            "sub-header1"
            "sub-header2"
            "map-section";
    }

    .container {
        grid-template-areas:
            "about-section";
        height: 10vh;
    }

    section.about-section img {
        width: 90%;
        height: auto;
    }

    .thumbnail-text {
        font-size: 1rem;
    }

    header {
        display: inline;
    }

    header .item {
        font-size-adjust: none;
    }

    header.sub-header {
        font-size: 0.8em;
    }

    .main-header .title {
        font-size: 1.2rem;
    }

    header a:not(:first-child) {
        display: none;
    }

    header a.icon.item {
        float: right;
        position: absolute;
        display: block;
        right: 0.1rem;
        top: 0.5rem;
        justify-content: center;
        color: #ababab;
        font-size: 0.8rem;
    }

    header a.icon.filter-item {
        float: right;
        position: absolute;
        display: block;
        right: 1rem;
        top: 0.1rem;
        justify-content: center;
        color: #ababab;
        font-size: 0.9rem;
    }

    header a.icon:hover {
        color: black;
    }

    header a.title.filter-item {
        font-size: 0.9rem;

    }

    header.responsive {
        position: relative;
        display: block;
        height: auto;

    }

    header.responsive .icon {
        position: absolute;
        right: 0.5rem;
        top: 0.5rem;
    }

    header.responsive a {
        float: none;
        display: block;
        text-align: left;
    }

    section.about-section {
        margin: 0 auto;
        padding: 5px;
    }

}

@media only screen and (max-width: 650px) {
    #scrollButton button {
        font-size: 1rem;
        height: 36px;
        width: 36px;
    }

    #scrollButton button span {
        font-size: 0.5rem;
    }

    #scrollButton ul {
        font-size: 1.0rem;
        bottom: 40px;
        right: 10px;
        width: 220px;
        max-width: 220px;
    }
}

@media only screen and (max-width: 525px) {
    #dataSource-table {
        word-break: break-all;
        font-size: 0.7rem;
        margin: 0;
        padding: 0;
    }

    footer p {
        font-size: 0.8rem;
    }
}

@media only screen and (max-width: 500px) {
    body {
        grid-template-rows: auto auto auto 1fr;
        grid-template-areas:
            "main-header"
            "sub-header1"
            "sub-header2"
            "map-section";
        height: 100vh;
    }

    .container {
        grid-template-areas:
            "about-section";
        height: 10vh;
    }

    header {
        display: inline;
    }

    header.main-header {
        font-size: 1.2rem;
    }

    .main-header .title {
        font-size: 0.8em;
    }

    header.sub-header {
        font-size: 0.8em;
    }

    section.about-section {
        margin: 0 auto;
        padding: 5px;
    }

}