.topic_icon-container {
    display: flex;
    flex-wrap: wrap;
    /* Allow items to wrap onto the next line */
    width: 100%;
}

accordion-button:focus,
.accordion-button:not(.collapsed) {
    box-shadow: none !important;
    /* Disable box-shadow */
    background-color: #D4FCF0 !important;
    /* Corrected color */
}


/* Performance optimization for iPhone Safari */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

.paginator>ul>li {
    cursor: pointer;
}

.grid-container {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    contain: layout style;
    padding: 10px;
    gap: 20px;
    padding-bottom: 20px;
}

.checkbox-item {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 10px 15px;
    margin: 8px;
    font-size: 1em;
    color: #000;
    text-decoration: none;
    border-radius: 5px;
    -webkit-transition: background-color .3s ease;
    transition: background-color .3s ease;
    border: none;
    white-space: normal;
    word-break: break-word;
    min-width: 300px;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.checkbox-item>input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    pointer-events: none !important;
    clip: rect(0, 0, 0, 0) !important;
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    overflow: hidden !important;
}

.entertainment {
    background-color: #afeeee;
}

.checkbox-item.entertainment:focus-within,
.entertainment_checked {
    -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #3E7D7D;
    box-shadow: 0 0 0 6px #fff, 0 0 0 10px #3E7D7D;
    -webkit-transform: scale3d(1.05, 1.05, 1);
    transform: scale3d(1.05, 1.05, 1);
}

.information_searching {
    background-color: #ffc0cb;
}

.checkbox-item.information_searching:focus-within,
.information_searching_checked {
    -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #9A5B66;
    box-shadow: 0 0 0 6px #fff, 0 0 0 10px #9A5B66;
    -webkit-transform: scale3d(1.05, 1.05, 1);
    transform: scale3d(1.05, 1.05, 1);
}

.communications {
    background-color: #90ee90;
}

.checkbox-item.communications:focus-within,
.communications_checked {
    -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #258325;
    box-shadow: 0 0 0 6px #fff, 0 0 0 10px #258325;
    -webkit-transform: scale3d(1.05, 1.05, 1);
    transform: scale3d(1.05, 1.05, 1);
}

.transactions {
    background-color: #ffe4b5;
}

.checkbox-item.transactions:focus-within,
.transactions_checked {
    -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #866B3C;
    box-shadow: 0 0 0 6px #fff, 0 0 0 10px #866B3C;
    -webkit-transform: scale3d(1.05, 1.05, 1);
    transform: scale3d(1.05, 1.05, 1);
}

.resetBtn {
    width: 200px;
    margin-top: 5px;
    padding: 18px;
    border-radius: 8px;
    font-size: 1em;
    margin: 8px;
    background-color: #fff;
    color: inherit;
    border: solid 1px #1d6df7;
    -webkit-appearance: none;
    appearance: none;
}

img.between-image {
    height: 1.5em;
    width: 1.5em;
    margin: 6px;
}

.iconElement {
    height: 2.5em;
    width: 2.5em;
    margin: 6px;
}

.toggleMarker {
    height: 1.4em;
    width: 1.4em;
    margin: 6px;
    cursor: pointer;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
    will-change: transform;
}

.icon_element {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: space-between;
    justify-content: flex-start;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex: 1;
    flex: 1;
}

.icon_element>div:first-child {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    -webkit-align-items: center;
    align-items: center;
    gap: .25rem .5rem;
}

.icon_element .toggleMarker {
    margin-left: auto;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
    -webkit-align-self: center;
    align-self: center;
}

.expand {
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}

.topicElement {
    padding: 8px;
}

.mainContent .div_data_table_1>table tbody>tr.content-visible>td:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background-color: transparent;
}

.sec_item_topic {
    cursor: pointer;
    display: -webkit-flex;
    display: flex;
}

.expand_element {
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-flex: 1;
    flex: 1;
}

.topic_element {
    padding: 8px 0px;
    -webkit-flex: 5;
    flex: 5;
    line-height: normal;
    font-size: clamp(1.2em, 2vw + 1em, 1.7em) !important;
    color: #307F2E;
    font-weight: bold;
}

.browseBtn {
    text-align: center;
    width: 250px;
    background-color: #990f29;
    border: none;
    cursor: pointer;
    padding: 16px;
    color: #fff !important;
    text-decoration: none;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    margin: 10px 0px;
    font-size: 1em;
    border-radius: 100px;
    -webkit-transition: background-color .3s ease;
    transition: background-color .3s ease;
    -webkit-appearance: none;
    appearance: none;
}

a.browseBtn[href*="http"] {
    color: #fff !important;
    text-decoration: none;
}

.toggle-link,
.toggle-link:hover,
.toggle-link:visited {
    color: #1d6df7 !important;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
}

/* Bootstrap Collapse Styling */
.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

.accordion-button::after {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: auto;
    content: "";
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 1.25rem;
    transition: transform 0.2s ease-in-out;
}

.accordion-header {
    margin-bottom: 0 !important;
}

.accordion-button:not(.collapsed)::after {
    transform: rotate(-180deg);
}

@media (hover: hover) and (pointer: fine) {
    .entertainment:hover {
        -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #5D9C9C;
        box-shadow: 0 0 0 6px #fff, 0 0 0 10px #5D9C9C;
        -webkit-transform: scale3d(1.05, 1.05, 1);
        transform: scale3d(1.05, 1.05, 1);
    }

    .information_searching:hover {
        -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #BF7F8B;
        box-shadow: 0 0 0 6px #fff, 0 0 0 10px #BF7F8B;
        -webkit-transform: scale3d(1.05, 1.05, 1);
        transform: scale3d(1.05, 1.05, 1);
    }

    .communications:hover {
        -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #46A446;
        box-shadow: 0 0 0 6px #fff, 0 0 0 10px #46A446;
        -webkit-transform: scale3d(1.05, 1.05, 1);
        transform: scale3d(1.05, 1.05, 1);
    }

    .transactions:hover {
        -webkit-box-shadow: 0 0 0 6px #fff, 0 0 0 10px #A78C5D;
        box-shadow: 0 0 0 6px #fff, 0 0 0 10px #A78C5D;
        -webkit-transform: scale3d(1.05, 1.05, 1);
        transform: scale3d(1.05, 1.05, 1);
    }
}

@media (max-width: 940px) {


    .accordion-button {

        position: relative;
        display: flex;
        flex-direction: row;
        width: 100%;
        padding: var(--bs-accordion-btn-padding-y) var(--bs-accordion-btn-padding-x);
        font-size: 1rem;
        color: var(--bs-accordion-btn-color);
        text-align: left;
        background-color: var(--bs-accordion-btn-bg);
        border: 0;
        border-radius: 0;
        overflow-anchor: none;
        transition: var(--bs-accordion-transition);

    }

    .accordion-button::after {

        width: 50%;

    }

    .sec_content {
        border-bottom: 1px solid #dee2e6 !important;
    }

    .browseBtn {
        width: 180px;
        font-size: 0.8em;
        padding: 10px;
    }

    .grid-container {
        display: -webkit-grid;
        display: grid;
        -webkit-grid-template-columns: repeat(1, 1fr);
        grid-template-columns: repeat(1, 1fr);
        gap: 8px;
    }

    .checkbox-item {
        padding: 6px 12px;
        font-size: .8em;
        min-width: unset;
    }

    .resetBtn {
        padding: 6px 12px;
    }

    .entertainment_checked,
    .information_searching_checked,
    .communications_checked,
    .transactions_checked {
        -webkit-box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--category-color);
        box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--category-color);
        -webkit-transform: scale3d(1.02, 1.02, 1);
        transform: scale3d(1.02, 1.02, 1);
    }

    .entertainment_checked {
        --category-color: #afeeee;
    }

    .information_searching_checked {
        --category-color: #ffc0cb;
    }

    .communications_checked {
        --category-color: #90ee90;
    }

    .transactions_checked {
        --category-color: #ffe4b5;
    }

    .topic_element {
        padding: unset;
        font-size: clamp(1.1em, 1.3em, 1.4em) !important;
    }

    body .mainContent .div_data_table_1>table tbody>tr>td {
        padding: unset;
    }

    body .mainContent .div_data_table_1>table tbody>tr>td:last-child {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    body .mainContent .div_data_table_1>table tbody>tr>td:first-child {
        padding-top: 0px;
    }

    .sec_item_topic {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "topic topic"
            "icons expand";
        grid-row-gap: 4px;
        align-items: center;
        border-bottom: 1px solid #dee2e6;
        /* border-radius: .5rem; */
        overflow: hidden;
        /* contain: layout; */
        padding: 10px 0;
    }

    .sec_item_topic.absolute {
        display: table-row !important;
        position: relative;
    }

    .sec_item_topic.absolute .expand_element {
        position: absolute;
        bottom: 0;
        right: 0;
    }

    .sec_item_topic>td {
        border: 0 !important;
        display: block;
        width: 100%;
        padding: 8px 12px;
        background: transparent;
    }

    .sec_item_topic>td.topic_element {
        grid-area: topic;
        width: 100%;
    }

    .sec_item_topic>td.icon_element {
        grid-area: icons;
        width: auto;
        padding-right: 0;
    }

    .sec_item_topic>td.expand_element {
        grid-area: expand;
        width: auto;
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        padding-left: 0;
    }

    .icon_element {
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
        -webkit-align-items: center;
        align-items: center;
        width: 100%;
        gap: .25rem .5rem;
    }

    .icon_element>div:first-child {
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-justify-content: flex-start;
        justify-content: flex-start;
        -webkit-align-items: center;
        align-items: center;
        gap: .25rem .5rem;
    }

    .icon_element .toggleMarker {
        margin-left: auto;
        -webkit-flex-shrink: 0;
        flex-shrink: 0;
        -webkit-align-self: center;
        align-self: center;
    }

    .mainContent .div_data_table_1>table tbody>tr>td:after {
        display: none !important;
    }

    /* Bootstrap accordion mobile styles */
    .accordion-button {
        padding: 1rem;
        font-size: 1rem;
    }

    .accordion-button::after {
        width: 1rem;
        height: 1rem;
        background-size: 1rem;
    }

    .topic_icon-container {
        flex-direction: column;
    }

    .accordion-body {

        padding: 10px !important;
        font-size: clamp(0.6em, 1vw + 0.6em, 1em) !important;

    }
}

@supports (-webkit-touch-callout: none) {
    .checkbox-item {
        -webkit-user-select: none;
        user-select: none;
    }

    .toggleMarker {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

/* Ensure responsiveness on iPad Pro */
@media (max-width: 1024px) {
    .checkbox-item {
        flex: 1 1 45%;
        /* Two items per row on smaller screens */
    }
}
