/* Core Form and Search Styles */
#frm {
    max-width: 1000px;
    margin: 20px auto;
    font-family: Arial, sans-serif;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.filter-header .title {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.search-input-container {
    max-width: 300px;
}

.search_container {
    position: relative;
    display: block;
    width: 100%;
    height: 50px;
    padding: 3px 5px;
    border: 1px solid #949497;
    border-radius: 8px;
    background-color: #FFFFFF;
    overflow: hidden;
}

.search-input-container input[type="text"] {
    border: none;
    padding: 8px 10px;
    flex-grow: 1;
    outline: none;
    font-size: 16px;
}

.search-input-container .search-button {
    background: #A9262F;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Filter Chips Area */
.filter-chips-area {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: space-between;
}

.sections {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    row-gap: 15px;
}

.sec-chip {
    padding: 8px 15px;
    border-radius: 20px;
    background: #f7f7f7;
    color: #835802;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sec-chip.selected {
    background: #F8EFE9;
    color: #000;
}

/* Specific styling for '在籍区分' and 'プログラムタイプ' chips based on your design */
.sec-chip.special-chip {
    padding: 8px 10px;
    border-radius: 16px;
    background: #e8e8e8;
}

.sec-chip.special-chip.selected {
    background: #d3b270;
}

.count-badge {
    background: #d3b270;
    color: white;
    padding: 4px 8px;
    border-radius: 50%;
    font-size: 14px;
    margin-left: 10px;
}

.clear-all {
    padding: 0px 15px 0px 5px;
    border: none;
    background: none;
    color: #000;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    gap: 5px;
}

/* Filter Pills (Selected items) */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.pill {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    background: #A9262F;
    color: white;
    border-radius: 4px;
    font-size: 14px;
}

.pill .rm {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-head {
    background: #A9262F;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-head h2 {
    margin: 0;
    font-size: 1.2em;
    text-align: center;
    width: 100%;
}

.modal-head .close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    position: absolute;
    right: 25px;
}

.modal-body {
    padding: 20px;
    padding-top: 10px;
    max-height: 70vh;
    overflow-y: auto;
    flex-grow: 1;
}

/* Crumbs/Navigation */
.crumbs {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.crumbs .crumb-back-btn {
    background: #A9262F;
    color: white;
    cursor: pointer;
    margin-right: 10px;
    padding: 5px 10px;
    border-radius: 0px;
}

/* Root Search */
.root-search {
    display: none; 
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px;
}

.root-search.visible {
    display: flex;
    width: 64%;
    max-width: 100%; 
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 15px;;
}

.root-search .crumb-back-btn{
    background: #A9262F;
    color: white;
    cursor: pointer;
    margin-right: 0px;
    padding: 5px 10px;
    border-radius: 0px;
}

.root-search input {
    border: none;
    padding: 8px 10px;
    flex-grow: 1;
    outline: none;
}

.root-search .search-button {
    /* Style the search button icon inside the modal search bar */
    background: #A9262F;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 0px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* List Rows (Items/Groups) */
.list {
    display: flex;
    flex-direction: column;
}

.row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    cursor: pointer;
    position: relative;
}

.row:hover {
    background-color: #f9f9f9;
}

.row:last-child {
    border-bottom: none;
}

.row .name {
    flex-grow: 1;
    padding-left: 10px; /* Space for checkbox or group */
}

/* Group Row (Navigation) */
.row .count-badge {
    margin-right: 15px;
}

.row div.name:after {
    position: absolute;
    top: 14px;
    right: 15px;
    display: block;
    content: "";
    width: 11px;
    height: 14px;
    background: url(../../img/icn_arrow_r.svg) no-repeat center center;
    background-size: 100% auto;
}


.row .enter-arrow {
    background: #A9262F;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Leaf Row (Checkbox) */
.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    background: white;
    transition: background-color 0.1s;
    position: absolute;
    left: 0;
}

clear-chip-icon {
    font-weight: bold;
    font-size: 14px;
    margin-left: 5px;
    padding: 0 4px;
    cursor: pointer;
    line-height: 1;
    color: #A9262F;
    opacity: 0.8;
    transition: opacity 0.1s;
}

.clear-chip-icon:hover {
    opacity: 1;
    color: #000;
}

.clear-chip-icon:focus {
    outline: 2px solid #000;
    border-radius: 2px;
}

.custom-checkbox.checked {
    background: #A9262F;
    border-color: #A9262F;
}

.row label.name {
    padding-left: 30px; /* Offset for the custom checkbox */
    cursor: pointer;
}

/* Select All Row (Same styling as a leaf row) */
.select-all-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    position: relative;
    font-weight: bold;
}

.select-all-row .name {
    padding-left: 30px;
}

.select-all-row .custom-checkbox {
    position: absolute;
    left: 0;
}

/* Modal Footer */
.modal-foot, .modal-foot-submit {
    display: flex;
    justify-content: space-between;
}

.modal-foot-submit{
    display: flex;
    justify-content: space-between;
}

.modal-foot.hidden, .modal-foot-submit.hidden {
    display: none;
}

.foot-btn {
    flex-grow: 1;
}

.foot-btn {
    padding: 15px 20px;
    border-radius: 0px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    text-align: center;
    border: 1px solid transparent;
}

.foot-btn.btn-secondary,
.foot-btn.ghost{
    background: #eee;
    color: #333;
}

.foot-btn.btn-danger {
    background: #A9262F;
    color: #fff;
    /*border-color: #A9262F;*/
}

.foot-btn:hover,.foot-btn:focus {
    background: #000;
    color: #fff;
    outline: none!important;
}

#btnSubmit, #btnAdd, #btnClear, #btnBack {
    white-space: nowrap;
}

.filter-group-header {
    background-color: #f5f5f5;
    font-weight: bold;
    padding: 10px;
    cursor: default !important;
    border-bottom: 1px solid #ddd;
    margin-top: 10px;
}

.wysiwyg .unique_box-school{
    max-width: max-content!important;
    padding: 10px!important;
}
.unique_box-school p{
    max-width: max-content!important;
}

.unique_box-school * + p{
    margin-top: 10px!important;
}

.unique_box-school a{
    color: #005B9C!important;
}
/*
Layout css
 */
.search-wrap {
    display: block;
}

.search-nav{
    background: #ffffff;
    padding: 10px 85px;
}

.search-box {
    padding: 10px 85px 45px;
}

.search-result-header {
    padding: 15px 0 5px 0;
    border-bottom: 2px solid #ddd;
    margin-top: 15px;
    cursor: default !important;
}
.search-result-header h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
    color: #333;
}

#frm{
    max-width: 100%;
}
.filter{
    margin-left: 0;
}
@media screen and (max-width: 768px) {
    .filter-header {
        display: block;
        margin-bottom: 15px;
    }

    .filter {
        cursor: pointer;
        justify-content: left;
        width: 100%;
        margin: 3vw 0;
        padding: 0;
        background-color: #ffffff;
        font-size: 18px;
    }

    .search-nav{
        padding: 6% 6.4% 3%;
    }
    .search-box {
        padding: 3% 6.4% 10%;
        background-color: #ffffff;
    }
    .root-search.visible {
        width: 72%; 
        max-width: 100%; 
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 15px;
    }
}

@media screen and (min-width: 769px) and ( max-width: 1189px) {
    .search-wrap {
        display: block;
    }
}

.result-order-ttl {
    white-space: nowrap;
}