/**
 * tom-select.css (v//@@version)
 * Copyright (c) contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at:
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 *
 */
 :root {
    --ts-pr-clear-button:	0;
    --ts-pr-caret:	0;
    --ts-pr-min:	.75rem;
  }

  .ts-wrapper.single .ts-control, .ts-wrapper.single .ts-control input {
    cursor: pointer;
  }

  .ts-control {
    padding-right: max(var(--ts-pr-min), var(--ts-pr-clear-button) + var(--ts-pr-caret)) !important;
  }

  .ts-wrapper.plugin-drag_drop.multi > .ts-control > div.ui-sortable-placeholder {
    visibility: visible !important;
    background: #f2f2f2 !important;
    background: rgba(0, 0, 0, 0.06) !important;
    border: 0 none !important;
    box-shadow: inset 0 0 12px 4px #fff;
  }
  .ts-wrapper.plugin-drag_drop .ui-sortable-placeholder::after {
    content: "!";
    visibility: hidden;
  }
  .ts-wrapper.plugin-drag_drop .ui-sortable-helper {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .plugin-checkbox_options .option input {
    margin-right: 0.5rem;
  }

  .plugin-clear_button {
    --ts-pr-clear-button: 1em;
  }
  .plugin-clear_button .clear-button {
    opacity: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: calc(8px - 6px);
    margin-right: 0 !important;
    background: transparent !important;
    transition: opacity 0.5s;
    cursor: pointer;
  }
  .plugin-clear_button.form-select .clear-button, .plugin-clear_button.single .clear-button {
    right: max( var(--ts-pr-caret), 8px);
  }
  .plugin-clear_button.focus.has-items .clear-button, .plugin-clear_button:not(.disabled):hover.has-items .clear-button {
    opacity: 1;
  }

  .ts-wrapper .dropdown-header {
    position: relative;
    padding: 10px 8px;
    border-bottom: 1px solid #d0d0d0;
    background: #f8f8f8;
    border-radius: 3px 3px 0 0;
  }
  .ts-wrapper .dropdown-header-close {
    position: absolute;
    right: 8px;
    top: 50%;
    color: #303030;
    opacity: 0.4;
    margin-top: -12px;
    line-height: 20px;
    font-size: 20px !important;
  }
  .ts-wrapper .dropdown-header-close:hover {
    color: black;
  }

  .plugin-dropdown_input.focus.dropdown-active .ts-control {
    box-shadow: none;
    border: 1px solid #d0d0d0;
  }
  .plugin-dropdown_input .dropdown-input {
    border: 1px solid #d0d0d0;
    border-width: 0 0 1px 0;
    display: block;
    padding: 8px 8px;
    box-shadow: none;
    width: 100%;
    background: transparent;
  }
  .plugin-dropdown_input .items-placeholder {
    border: 0 none !important;
    box-shadow: none !important;
    width: 100%;
  }
  .plugin-dropdown_input.has-items .items-placeholder, .plugin-dropdown_input.dropdown-active .items-placeholder {
    display: none !important;
  }

  .ts-wrapper.plugin-input_autogrow.has-items .ts-control > input {
    min-width: 0;
  }
  .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control > input {
    flex: none;
    min-width: 4px;
  }
  .ts-wrapper.plugin-input_autogrow.has-items.focus .ts-control > input::placeholder {
    color: transparent;
  }

  .ts-dropdown.plugin-optgroup_columns .ts-dropdown-content {
    display: flex;
  }
  .ts-dropdown.plugin-optgroup_columns .optgroup {
    border-right: 1px solid #f2f2f2;
    border-top: 0 none;
    flex-grow: 1;
    flex-basis: 0;
    min-width: 0;
  }
  .ts-dropdown.plugin-optgroup_columns .optgroup:last-child {
    border-right: 0 none;
  }
  .ts-dropdown.plugin-optgroup_columns .optgroup:before {
    display: none;
  }
  .ts-dropdown.plugin-optgroup_columns .optgroup-header {
    border-top: 0 none;
  }

  .ts-wrapper.plugin-remove_button .item {
    display: inline-flex;
    align-items: center;
    padding-right: 0 !important;
  }
  .ts-wrapper.plugin-remove_button .item .remove {
    color: inherit;
    text-decoration: none;
    vertical-align: middle;
    display: inline-block;
    padding: 0 6px;
    border-radius: 0 2px 2px 0;
    box-sizing: border-box;
  }
  .ts-wrapper.plugin-remove_button .item .remove:hover {
    background: rgba(0, 0, 0, 0.05);
  }
  .ts-wrapper.plugin-remove_button.disabled .item .remove:hover {
    background: none;
  }
  .ts-wrapper.plugin-remove_button .remove-single {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 23px;
  }

  .ts-wrapper.plugin-remove_button:not(.rtl) .item .remove {
    border-left: 1px solid #d0d0d0;
    margin-left: 6px;
  }
  .ts-wrapper.plugin-remove_button:not(.rtl) .item.active .remove {
    border-left-color: #cacaca;
  }
  .ts-wrapper.plugin-remove_button:not(.rtl).disabled .item .remove {
    border-left-color: white;
  }

  .ts-wrapper.plugin-remove_button.rtl .item .remove {
    border-right: 1px solid #d0d0d0;
    margin-right: 6px;
  }
  .ts-wrapper.plugin-remove_button.rtl .item.active .remove {
    border-right-color: #cacaca;
  }
  .ts-wrapper.plugin-remove_button.rtl.disabled .item .remove {
    border-right-color: white;
  }

  .ts-wrapper {
    position: relative;
  }

  .ts-dropdown,
  .ts-control,
  .ts-control input {
    color: #303030;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    font-smoothing: inherit;
  }

  .ts-control,
  .ts-wrapper.single.input-active .ts-control {
    background: #fff;
    cursor: text;
  }

  .ts-control {
    border: 1px solid #787878;
    border-radius: 0.35rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    padding: 12px 15px;
    width: 400px;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    box-shadow: none;
    display: flex;
    flex-wrap: wrap;
    height: 100%;
  }
  .ts-wrapper.multi.has-items .ts-control {
    padding: calc( 7.5px - 0px) 12px calc( 7.5px - 0px) 12px;
    margin-top: -2px;
  }
  .full .ts-control {
    background-color: #fff;
  }
  .disabled .ts-control, .disabled .ts-control * {
    cursor: default !important;
  }
  .focus .ts-control {
    box-shadow: none;
  }
  .ts-control > * {
    vertical-align: baseline;
    display: flex;
    align-items: center;
    font-size: 16px;
  }
  .ts-wrapper.multi .ts-control > div {
    cursor: pointer;
    margin: 0 3px 3px 3px;
    padding: 2px 8px;
    background: #f2f2f2;
    color: #303030;
    border: 0px solid #d0d0d0;
  }
  .ts-wrapper.multi .ts-control > div.active {
    background: #e8e8e8;
    color: #303030;
    border: 0px solid #cacaca;
  }
  .ts-wrapper.multi.disabled .ts-control > div, .ts-wrapper.multi.disabled .ts-control > div.active {
    color: #7d7d7d;
    background: white;
    border: 0px solid white;
  }
  .ts-control > input {
    flex: 1 1 auto;
    min-width: 7rem;
    display: inline-block !important;
    padding: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    max-width: 100% !important;
    margin: 0 !important;
    text-indent: 0 !important;
    border: 0 none !important;
    background: none !important;
    line-height: inherit !important;
    user-select: auto !important;
    box-shadow: none !important;
  }
  .ts-control > input::-ms-clear {
    display: none;
  }
  .ts-control > input:focus {
    outline: none !important;
  }
  .has-items .ts-control > input {
    margin: 0px 4px !important;
  }
  .ts-control.rtl {
    text-align: right;
  }
  .ts-control.rtl.single .ts-control:after {
    left: 14px;
    right: auto;
  }
  .ts-control.rtl .ts-control > input {
    margin: 0px 4px 0px -2px !important;
  }
  .disabled .ts-control {
    opacity: 0.5;
    background-color: #fafafa;
  }
  .input-hidden .ts-control > input {
    opacity: 0;
    position: absolute;
    left: -10000px;
  }

  .ts-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10;
    border: 1px solid #d0d0d0;
    background: #fff;
    margin: 0.25rem 0 0 0;
    border-top: 0 none;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 3px 3px;
  }
  .ts-dropdown [data-selectable] {
    cursor: pointer;
    overflow: hidden;
  }
  .ts-dropdown [data-selectable] .highlight {
    background: rgba(125, 168, 208, 0.2);
    border-radius: 1px;
  }
  .ts-dropdown .option,
  .ts-dropdown .optgroup-header,
  .ts-dropdown .no-results,
  .ts-dropdown .create {
    padding: 5px 8px;
  }
  .ts-dropdown .option, .ts-dropdown [data-disabled], .ts-dropdown [data-disabled] [data-selectable].option {
    cursor: inherit;
    opacity: 0.5;
  }
  .ts-dropdown [data-selectable].option {
    opacity: 1;
    cursor: pointer;
  }
  .ts-dropdown .optgroup:first-child .optgroup-header {
    border-top: 0 none;
  }
  .ts-dropdown .optgroup-header {
    color: #303030;
    background: #fff;
    cursor: default;
  }
  .ts-dropdown .active {
    background-color: #f5fafd;
    color: #495c68;
  }
  .ts-dropdown .active.create {
    color: #495c68;
  }
  .ts-dropdown .create {
    color: rgba(48, 48, 48, 0.5);
  }
  .ts-dropdown .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    margin: 5px 8px;
  }
  .ts-dropdown .spinner:after {
    content: " ";
    display: block;
    width: 24px;
    height: 24px;
    margin: 3px;
    border-radius: 50%;
    border: 5px solid #d0d0d0;
    border-color: #d0d0d0 transparent #d0d0d0 transparent;
    animation: lds-dual-ring 1.2s linear infinite;
  }
  @keyframes lds-dual-ring {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }

  .ts-dropdown-content {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 200px;
    overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  .ts-hidden-accessible {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important;
  }

/* 학생 선택 영역 스타일 */
.title-box.border.space {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    margin-bottom: 25px;
    background: transparent;
}

.title-box .select-box {
    display: flex;
    justify-content: flex-end;
}

.title-box .select-box h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-box .select-box h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 20px;
    background: #3096d1;
    border-radius: 2px;
}

/* 멀티셀렉트 영역 */
.detail-box-multiselect {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    max-width: fit-content;
}

.detail-box-multiselect .detail-word {
    padding: 8px 12px;
    background: #f0f7ff;
    border-left: 3px solid #3096d1;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
    color: #1565c0;
    font-weight: 500;
    letter-spacing: -0.3px;
    width: 420px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.detail-box-multiselect .detail-word br {
    display: block !important;
    content: "" !important;
}

/* 셀렉트와 버튼 컨테이너 */
.detail-box-multiselect > select,
.detail-box-multiselect > button {
    margin-top: 0;
}

/* 멀티 셀렉트 박스 스타일 개선 */
#studentIdListMulti {
    width: 300px;
    min-height: 42px;
    max-height: 150px;
    padding: 10px 12px;
    border: 1px solid #d0dce8;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fff;
    transition: all 0.2s ease;
    overflow-y: auto;
    flex-shrink: 0;
}

/* TomSelect wrapper 높이 조정 */
.detail-box-multiselect .ts-wrapper {
    width: 300px !important;
    flex-shrink: 0;
    box-sizing: border-box !important;
}

.detail-box-multiselect .ts-wrapper .ts-control {
    min-height: 42px !important;
    height: auto !important;
    padding: 8px 10px !important;
    width: 300px !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
}

.detail-box-multiselect .ts-wrapper .ts-control .item {
    font-size: 14px !important;
    font-weight: 500 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.detail-box-multiselect .ts-wrapper .ts-control input {
    font-size: 14px !important;
    font-weight: 500 !important;
    min-width: 100px !important;
    flex: 1 !important;
}

.detail-box-multiselect .ts-wrapper .ts-control input::placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

/* 항목이 선택되었을 때 input 조정 */
.detail-box-multiselect .ts-wrapper.has-items .ts-control > input {
    min-width: 4px !important;
    width: auto !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 선택된 항목이 있을 때 컨트롤 영역 조정 */
.detail-box-multiselect .ts-wrapper.has-items .ts-control {
    cursor: text !important;
    height: 42px !important;
    overflow: hidden !important;
}

#studentIdListMulti:focus {
    outline: none;
    border-color: #3096d1;
    box-shadow: 0 0 0 2px rgba(48, 150, 209, 0.1);
}

#studentIdListMulti option {
    padding: 8px;
    border-radius: 3px;
    margin: 2px 0;
    font-size: 14px;
}

#studentIdListMulti option:checked {
    background: #3096d1;
    color: #fff;
    font-weight: 600;
}

/* 재원생 확인 버튼 */
#searchAttendStudent {
    width: 120px;
    height: 42px;
    background: #3096d1;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.3px;
    flex-shrink: 0;
    white-space: nowrap;
    box-sizing: border-box;
}

#searchAttendStudent:hover {
    background: #2678b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(48, 150, 209, 0.2);
}

#searchAttendStudent:active {
    transform: translateY(0);
    box-shadow: none;
}

#searchAttendStudent:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(48, 150, 209, 0.3);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .detail-box-multiselect {
        flex-wrap: wrap;
    }

    .detail-box-multiselect .detail-word {
        width: 100%;
        white-space: normal;
    }

    .detail-box-multiselect .detail-word br {
        display: block;
    }
}

@media (max-width: 768px) {
    .title-box.border.space {
        justify-content: center !important;
        padding: 15px;
        margin-bottom: 20px;
    }

    .title-box .select-box {
        width: 100%;
        justify-content: center !important;
        display: flex;
    }

    .title-box .select-box h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .detail-box-multiselect {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .detail-box-multiselect .detail-word {
        white-space: normal;
        padding: 10px 12px;
        font-size: 12px;
        line-height: 1.5;
        width: 100%;
        text-align: center;
    }

    .detail-box-multiselect .detail-word br {
        display: block;
    }

    .detail-box-multiselect .ts-wrapper {
        width: 100% !important;
    }

    .detail-box-multiselect .ts-wrapper .ts-control {
        width: 100% !important;
        height: auto !important;
        min-height: 42px !important;
    }

    #studentIdListMulti {
        width: 100%;
        min-height: 42px;
        padding: 10px 12px;
        font-size: 14px;
    }

    #searchAttendStudent {
        width: 100%;
        height: 42px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .title-box.border.space {
        padding: 12px;
    }

    .title-box .select-box h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .detail-box-multiselect {
        gap: 8px;
    }

    .detail-box-multiselect .detail-word {
        font-size: 11px;
        padding: 8px 10px;
    }

    #studentIdListMulti {
        font-size: 13px;
        padding: 8px 10px;
    }

    #searchAttendStudent {
        height: 40px;
        font-size: 13px;
    }
}
