/* 全局样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

/* 页面居中 */
#app_background {
    min-height: 100vh;
    background: linear-gradient(135deg, rgb(221, 221, 221), rgb(221, 221, 221));
    font-family: Arial, sans-serif;
    padding: 20px;
    text-align: center;
    margin: 0;
    padding-bottom: 80px;
}

h1 {
    font-size: 30px;
    color: #333;
    margin-top: 20px;
}


/* 限制每屆內容的顯示區塊 */
.section {
    margin-bottom: 30px;
}

.new_btn {
    margin: 10px 0;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #637485;
    color: white;
    border: none;
    border-radius: 5px;
}

.new_btn:hover {
    background-color: rgb(52, 68, 85);
}

.btn_save {
    background-color: #3c7fc3;
    color: white;
    border: none;
}

.btn_save:hover {
    background-color: #80b2e4;
}

.content-container {
    max-height: 100vh;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Upload row layout (left aligned): name | spinner | action */
.uploading-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start;
}

.uploading-row__name {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uploading-row__spinner {
    flex: 0 0 auto;
}

.uploading-row__action {
    flex: 0 0 auto;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
}

.modal-header {
    font-size: 18px;
    font-weight: bold;
}

.modal-body {
    margin: 10px 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: 70vh;
}


.time-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-grow: 1;
}

.time-group input.form-control,
.time-group .input_text {
    flex: 1 1 0;
    min-width: 0;
}

.time-group .input_text {
    padding: 8px 10px;
}

.time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-display .time_text {
    white-space: nowrap;
    font-weight: bold;
}

label {
    width: 80px;
    text-align: right;
    white-space: nowrap;
}

.title_label {
    width: 150px;
    text-align: right;
}

.form-control {
    flex: 1;
}

.meeting-upload {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    flex: 1;
}

.meeting-input {
    flex: 1 1 0;
    max-width: 300px;
    min-width: 150px;
    margin-bottom: 8px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    margin-left: 16px;
    min-width: 100px;
}


.input_text {
    text-align: left;
    font-size: large;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
    padding-bottom: 5px;
}

.person-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    line-height: 1.5;
}

.person-info .email {
    word-break: break-all;
}

.breakable-text {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: break-word;
    display: block;
}

.time_text {
    text-align: left;
    font-size: large;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
    padding-bottom: 5px;
}

.normal_text {
    text-align: left;
    display: inline-block;
    font-weight: normal;
    padding: 0;
    margin: 0;

}


.agenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.members-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 16px;
    white-space: nowrap;
    padding-bottom: 10px;
}

.member-row {
    display: flex;
    gap: 60px;
}

.member-col {
    display: flex;
    min-width: 220px;
}

.persontitle {
    flex: 1;
    text-align: justify;
    padding-right: 10px;
}

.name {
    white-space: nowrap;
}

.detail_btn {
    white-space: nowrap;
    padding: 1.5px 4px;
    cursor: pointer;
    background-color: #637485;
    color: white;
    border: none;
    border-radius: 5px;
}

.detail_btn:hover {
    background-color: #a9bed5;
}

.item_btn {
    margin: 10px 0;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #7e9cbc;
    color: white;
    border: none;
    border-radius: 5px;
    min-width: 500px;
}

.item_btn:hover {
    background-color: #435c77;
}

.item-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.delete_btn {
    white-space: nowrap;
    padding: 1.5px 4px;
    cursor: pointer;
    background-color: #c71d1d;
    color: white;
    border: none;
    border-radius: 5px;
}

.delete_btn:hover {
    background-color: #ea4646;
}

.detail-wrapper {
    &.editable {
        margin-left: 10px;
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 0.5rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        position: relative;
        margin-bottom: 0.5rem;
    }

    &.readonly {
        margin: 5px 0 0 30px;
        text-align: left;
    }
}

.detail-text {
    white-space: pre-line;
    text-align: left;
    display: block;
    padding-left: 3em;
    text-indent: -3em;
}


.text-row {
    display: flex;
    align-items: flex-start;
    margin-left: 2em;
}

.normal_text_show {
    flex-shrink: 0;
}

.explain-text {
    white-space: pre-line;
    flex-grow: 1;
}

.schedule_btn {
    white-space: nowrap;
    padding: 2px 5px;
    cursor: pointer;
    background-color: #5593d0;
    color: white;
    border: none;
    border-radius: 5px;
}

.schedule_btn:hover {
    background-color: #0e355f;
}

.button-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.scroll-top-btn {
    position: absolute;
    bottom: 100px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 30px;
}

.scroll-top-btn:hover {
    background-color: #495057;
    transform: translateY(-3px);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-box {
    background-color: #fff;
    padding: 20px 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.loading-text {
    margin-left: 15px;
    font-size: 1.2rem;
    color: #333;
}

.custom-spinner {
    color: #2b642d;
}

.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    border-radius: 34px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.4s;
}

.slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

input:checked+.slider {
    background-color: #4c7aaf;
}

input:checked+.slider::before {
    transform: translateX(28px);
}

.auto-resize-textarea {
    resize: none;
    overflow: hidden;
    min-height: 3rem;
    line-height: 1.5;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #333;
    padding: 10px 15px;
    flex-wrap: wrap;
    font-size: larger;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo {
    height: 50px;
    display: block;
}

.system-title {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

/* 漢堡按鈕（手機用） */
.menu-toggle {
    font-size: 24px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: none;
}

nav ul {
    list-style-type: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 10px;
}

nav ul li a:hover {
    background-color: #575757;
    color: black;
}

/* 手機版 RWD */
@media (max-width: 768px) {

    .item-row {
        flex-direction: row;
        justify-content: center;
        gap: 5px;
    }

    .item_btn {
        min-width: 100%;
        box-sizing: border-box;
        margin: 5px 0;
    }

    .delete_btn {
        min-width: 25px;
        box-sizing: border-box;
        font-size: 14px;
    }

    .schedule_btn {
        min-width: 25px;
        box-sizing: border-box;
        font-size: 14px;
    }

    .detail_btn {
        min-width: 25px;
        box-sizing: border-box;
        font-size: 14px;
    }

    .btn_save {
        min-width: 25px;
        box-sizing: border-box;
        font-size: 14px;
    }

    .btn-secondary {
        min-width: 25px;
        box-sizing: border-box;
        font-size: 14px;
    }


    .scroll-top-btn {
        position: absolute;
        width: 35px;
        height: 35px;
        bottom: 85px;
        right: 10px;
        font-size: 25px;
    }

    .detail-wrapper {
        &.editable {
            margin-left: -5px;
        }
    }

    .menu-toggle {
        display: block;
    }

    nav {
        width: 100%;
        display: none;
    }

    nav.open {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav ul li a {
        display: block;
        border-top: 1px solid #444;
        padding: 12px 20px;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    /* 只顯示 modal 本體與其內部 */
    .modal,
    .modal * {
        visibility: visible !important;
    }

    /* 讓 modal 本身仍保留 layout */
    .modal {
        position: absolute !important;
        overflow: visible !important;
        left: 0;
        top: 0;
        width: 100% !important;
    }

    .modal-dialog {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .modal-content {
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
    }

    .modal-body {
        max-height: none !important;
        overflow: visible !important;
    }

    .modal-backdrop {
        display: none !important;
    }

    .input_text {
        font-size: 14pt;
        line-height: 1.5;
    }

    /* 如果你還是要隱藏按鈕之類的 */
    .file-input,
    .visible,
    .scroll-top-btn,
    .btn,
    .close {
        display: none !important;
    }
}


/* Footer 样式 */
footer {
    text-align: center;
    padding: 20px;
    background-color: #333;
    color: white;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 60px;
}