/* 滾動條整體樣式 */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}
/* 滾動條軌道 */
::-webkit-scrollbar-track {
    background: rgba(241, 241, 241, 0.6);
}
/* 滾動條滑塊 */
::-webkit-scrollbar-thumb {
    background: rgba(136, 136, 136, 0.6);
    border-radius: 6px;
}
/* 滾動條滑塊懸停時 */
::-webkit-scrollbar-thumb:hover {
    background: rgba(85, 85, 85, 0.8);
    cursor: grab;
}
::-webkit-scrollbar-thumb:active {
    cursor: grabbing;
}

/* Loading 遮罩的樣式 */
#loading {
    position: fixed;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 1.0);
    opacity: 1;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 1.5s ease-in-out;
}
#loading.hidden-items {
    opacity: 0;
    z-index: -9999;
}
/* 簡單的 loading 動畫 */
.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2C3E50;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}
/* 旋轉動畫 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body {
    font-family: 'Arial', 'sans-serif', '微軟正黑體';
    overflow: hidden;
    display: flex;
    justify-content: center;
    /* align-items: center; */
    height: 99vh;
    background: #f0f0f0;
}
.main-container {
    position: relative;
    width: 100%; height: 99%;
    display: flex;    
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 12px;
}
.main-container input[type="text"], .main-container input[type="number"] {
    width: 3em;
    text-align: center;
    outline: none;
}
.main-container input[type="checkbox"] {
    margin-right: 1em;
    cursor: pointer;
}
.main-container label {
    cursor: pointer;
}
button {
    background: #2C3E50;
    box-shadow: #2c3e505a 1px 1px 2px 0;
    color: white;
    border: none; border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}
button:active, button.active {
    transform: translate(1px, 1px);
}
/* #patInfoBox {
    position: relative;
    display: block;
    display: flex; flex-direction: column;
    width: auto; height: auto;
    margin-right: 2px;
    padding: 5px;
    background: rgb(209, 217, 250);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 12px;
    z-index: 1001;
    transform: translateX(0);
    align-items: center;
    transition: all 0.3s ease-in-out;
}
#patInfoBox table {
    border-collapse: separate;
    border-spacing: 2px 2px;
    border-radius: 8px;
}
#patInfoBox th, #patInfoBox td {
    background: rgba(230, 235, 255, 0.5);
    cursor: auto;
}
#patInfoBox button {
    background: rgb(36, 44, 152);
} */
#appom_history {
    flex-grow: 1;
    width: 180px;
    overflow-y: auto;
}
.ahBtnZone {
    margin: 0.5em auto;
    align-items: center;
    text-align: center;
}
.ahBtnZone button {
    margin-bottom: 2px;
}
.minor-left {
    position: relative;
    z-index: 1000;
    display: flex; flex-direction: column;
    transform: translateX(0);
    width: auto; height: 94vh;
    padding: 20px;
    align-items: center;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
    /* 觸控設備優化 */
    -webkit-transform: translateX(0);
    will-change: transform;
}
.mini-calendar {
    position: relative;
    width: 200px;
    border-radius: 8px;
    font-size: 10px;
}
.mini-calendar thead th {
    font-stretch: ultra-condensed;
}
.fullcalendar {
    width: 100%; height: 94%;
    background: none;
    padding: 20px;
    border-radius: 8px;
    font-size: 10px;
    transition: all 0.3s ease-in-out;
}
.fc-header-toolbar {
    padding-top: 1em;
    padding-left: 1em;
    padding-right: 1em;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: larger;
    background: none;
}
.calendar-header button {
    color: #2C3E50; font-weight: bold;
    background: none;
    border: none;
    padding: 5px 10px; border-radius: 5px;
    cursor: pointer;
}
.calendar-header button:disabled {
    background: #cbcbcb;
    cursor: not-allowed;
}
#slot-tuner {
    visibility: hidden;
    display: block;
    position: relative;
    z-index: 999;    
    left: -22px;
    top: -200px;
    width: 0; height: 0;
    transition: transform 0.3s ease-in-out;
}
#slot-tuner button {
    position: relative;
    z-index: 1000;
    color: #2C3E50; font-weight: bold;
    background: white;
    border: none;    
    padding: 3px; border-radius: 5px;
    cursor: pointer;
}
.slotSlider {
    position: relative;
    z-index: 0;
    left: 8px;
    width: 3px;
    height: 140px;
    background-color: white;
    box-shadow: #2c3e505a 1px 1px 2px 0;
    cursor: pointer;
}
.slotHandle {
    width: 20px;
    height: 10px;
    background-color: white;
    box-shadow: #2c3e505a 1px 1px 2px 0;
    border-radius: 3px;
    position: absolute;
    top: 5px;
    left: -8px;
    z-index: 1000;
    transform: translateY(-50%);
    transition: top 0.2s linear;
    cursor: grab;
}
.slotHandle:active {
    transition: none;
    cursor: grabbing;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    height: 12px;
    text-align: center;
    padding: 5px;
    border: 1px solid #00000000;
    background: white;
    cursor: pointer;
}
th {
    background: #2C3E50;
    color: white;
    cursor: default;
}
.ul {
    border-radius: 5px 0 0 0;
}
.ur {
    border-radius: 0 5px 0 0;
}
.ll {
    border-radius: 0 0 0 5px;
}
.lr {
    border-radius: 0 0 5px 0;
}
.freetime-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 200px;    
    padding: 1em 0;
}
.other-month {
    background: rgba(0, 0, 0, 0.06);
    color: gray;
}
.today {
    font-weight: bold;
    background: #FFFADF;
    color: red;
}
.blocked {
    background: rgba(128, 128, 128, 0.4);
    cursor: not-allowed;
}
.hidden-items {
    display: none;
}
.doctors{
    flex-grow: 1;
    width: 100%; height: auto;
    overflow: auto;
    margin: 1em 0 0 0;
    font-size: 16px;
    letter-spacing: 2px;
    line-height: 2em;
}
.doctors button {    
    color: #2C3E50; font-weight: bold;
    background: none;
    border: none;
    margin-left: 3em;
    padding: 5px 10px; border-radius: 5px;
    cursor: pointer;
}
.group {
    margin-bottom: 10px;
}
.group-header {
    font-weight: bold;
}
.group-header label{
    display: inline-block;
    width: 8em;    
    cursor: pointer;
}
.toggle-group {
    position: relative;
    right: 2em;
}
.doctor-list {
    margin-left: 20px;
}
svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}
.modal {
    position: fixed;
    z-index: 3000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}
.highlight {
    position: relative;
    z-index: 1002;
    border: 3px solid red;
    margin: -3px;
    clip-path: none;
}
#eventFormVeil {
    position: fixed; top: 0; left: 0;
    z-index: 1999;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}
#eventFormBox {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    border-radius: 8px;
    padding: 1em;
    width: 320px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    text-align: center; color: black;/* text-shadow: 1px 1px 1px black;*/
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    line-height: 2em;
}
#eventFormBox .formbox-header {
    margin: -1em -1em 0 -1em;
    padding: 0 1em;
    border-radius: 8px 8px 0 0;
    background: #2C3E50;
    color: white;    
    text-align: left;
}
#eventFormBox .formbox-header:hover {
    cursor: grab;
}
#eventFormBox .formbox-header:active {
    cursor: grabbing;
}
#eventFormBox input, #eventFormBox textarea {    
    width: 96%;
    margin: 2px;
    padding: 5px;
    border: none; border-bottom: #2C3E50 1px solid;
    border-radius: 3px 3px 0 0;
    outline: none;
    background: none;
}
#eventFormBox input.requiredfields {
    border-bottom: red 1px solid;
    background: rgba(255, 100, 100, 0.1);
}
#eventFormBox button {
    margin: 0 0.2em;
    border: none;
    border-radius: 8px;
    background: white;
    color: #2C3E50;
    cursor: pointer;
}
#eventFormBox button.submit {
    margin: 0 0 0 0.8em;
    padding: 0.3em 1.5em;
    font-size: 1.2em;
}
#eventFormBox #eventFreetimesButtons {    
    text-align: left;
    margin: 0 2px;
    max-height: 100px;
    overflow-y: auto;
}
#eventFormBox #eventFreetimesButtons button.on {
    border: 1px solid #2C3E50;
    margin: 0 2px 0 1px;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.3);
    transform: translate(1px, 1px);    
}
#eventFormBox #eventCategoriesButtons {
    white-space: nowrap;
    width: 100%;
    overflow: auto;
    padding-bottom: 3px;
}
#eventFormBox #eventCategoriesButtons button.on {
    background: #2C3E50;
    color: white;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.3);
    transform: translate(1px, 1px);
}
#eventFormBox #eventFormBoxTitle {
    margin: 0.5em 0 0.2em 0;
    font-size: 1.5em;
}
#eventFormBox select{
    border: none; outline: none;
    margin: 0.5em 1em;
    font-size: 1.2em;
    background: none;
    cursor: pointer;
}
#eventFormBox option{
    cursor: pointer;
}
#eventFormBox #eventFormBoxDesc{
    height: 5em;
    resize: none;
    border-radius: 8px;
    padding: 0.5em;
    background: rgba(227, 238, 248, 0.5);
}
.languages {
    display: flex;
    position: absolute; z-index: 1000;
    top: 0; right: 50px;
    cursor: pointer;
}
.languages div {
    background: white;
    box-shadow: #2c3e505a 1px 1px 2px 0;
    color: #2C3E50;
    border: none;
    padding: 5px 10px;
    transition: all 0.3s ease-in-out;
}
.languages div.on {
    background: #2C3E50;
    color: white;
}

.home {
    position: absolute; z-index: 1000;
    top: 0; right: 25px;
    width: 20px; height: 20px;
    cursor: pointer;
}
.home img {
    width: 100%; height: 100%;
}
.question {
    position: absolute; z-index: 1000;
    top: 0; right: 0;
    width: 20px; height: 20px;
    cursor: pointer;
}
.question img {
    width: 100%; height: 100%;
}
.toggle-btn {
    display: none;
    position: fixed;
    width: 10px;
    top: 45vh;
    left: 10px;
    z-index: 1000;
    transform: translateX(0);
    background: #f0f0f0;
    color: #2C3E50;
    outline: none;
    box-shadow: #2c3e505a 5px 3px 5px 0;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 20px 15px 20px 5px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    /* 觸控設備優化 */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}
@media (max-width: 800px) {
    .toggle-btn {
        transform: translateX(0);
        display: block;
    }
    .toggle-btn.hover {
        transform: translateX(10px);
        /* margin-left: -20px;
        padding-left: 25px; */
    }
    .toggle-btn.open {
        transform: translateX(228px);
        padding: 20px 18px 20px 2px;
    }
    .minor-left {
        transform: translateX(-248px);
        position: fixed;
        top: 0;
        display: block;
        background: #f0f0f0;
        box-shadow: #2c3e505a 5px 3px 5px 0;        
        height: 94vh;
        padding-right: 30px;
    }
    .minor-left.hover {
        transform: translateX(-238px);
    }    
    .minor-left.open {
        transform: translateX(-20px);
    }
    /* #patInfoBox {
        transform: translateX(-228px);
        position: fixed;
        top: 0;
        display: block;
        box-shadow: #2c3e505a 5px 3px 5px 0;
        height: 94vh;
        padding-bottom: 35px;
    }
    #patInfoBox.open {
        transform: translateX(-8px);
    } */
    #slot-tuner {
        transform: translateX(-20px);
        z-index: 1001;
    }
    #slot-tuner.hover {
        transform: translateX(-10px);
    }
    #slot-tuner.open {
        transform: translateX(208px);
    }
}

#tempList {
    position: absolute;
    left: 0; top: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.9);
    width: 280px;
    padding: 10px;
    border-radius: 8px;
    cursor: move;
}

#tempList .fc-toolbar-title {
    font-size: 1.5em;
}

#tempList button {
    width: 30px;
    padding: 0;
    color: #2C3E50; font-weight: bold;
    background: white;
}

.fc-timegrid-body tr {
    height: 30px;
}
.fc-daygrid-day-events {
    display: flex;
    flex-wrap: wrap;
}
.fc-daygrid-day-events .fc-event {
    width: 20px !important;
    height: 20px !important;
    line-height: 18px;
    text-align: center;
    border-radius: 10px;
}
.fc-timegrid-bg-harness {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
}
.fc-timegrid-bg-harness .fc-event {
    width: 4vw;
    display: block;
}
.fc-bg-event, .fc-non-business {
    cursor: not-allowed;
    /* pointer-events: none; */
}
.fc-event.busy-true {
    background: gray;
    border: none;
    color: white;
    cursor: not-allowed;
    /* pointer-events: none; */
}
.fc .fc-day-today.blocked {
    background: rgba(128, 128, 128, 0.4);    
}
/* 不曉得為何文字色彩無法生效
.fc-event.busy-temp {
    background: white;
    border: red 1px solid;
    color: red !important;
} */
.fc-button:disabled {
    cursor: not-allowed;
}