﻿/* Custom Styles for Space Reservation System - WCAG AA Compliant */
/*:root {
    --bg-color: #F4F7F9;
    --primary-blue: #1E4E79;
    --text-main: #334155;
    --text-muted: #64748B;
    --input-bg: #F8FAFC;
    --focus-ring: rgba(30, 78, 121, 0.15);
    --border-radius-lg: 16px;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 30px rgba(30, 78, 121, 0.12);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Noto Sans TC', sans-serif;
    line-height: 1.6;
}*/

/* 高級感卡片設計 */
/*.custom-card {
    background: #FFFFFF;
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}*/

/* 精緻化表單輸入框 */
/*.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    transition: all 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus {
    background-color: #FFFFFF;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px var(--focus-ring);
    outline: none;
}*/


/* 有填寫內容的欄位自動標示底色，方便使用者辨識已填資料 */
/*.form-control.field-has-value,
.form-select.field-has-value {
    background-color: #FFF8DC !important;
    border-color: #E0B94F !important;
}

.form-control.field-has-value:focus,
.form-select.field-has-value:focus {
    background-color: #FFF8DC !important;
    border-color: #E0B94F !important;
}*/
/* Label 規範化 */
/*.form-label {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}*/

/* 主按鈕懸浮互動 (統一尺寸與風格) */
/*.btn-primary-custom, .btn-success-custom, .btn-danger-custom {
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary-custom {
    background-color: var(--primary-blue);
    box-shadow: 0 2px 10px rgba(30, 78, 121, 0.2);
}

.btn-success-custom {
    background-color: #198754;
    box-shadow: 0 2px 10px rgba(25, 135, 84, 0.2);
}

.btn-primary-custom:hover, .btn-primary-custom:focus {
    background-color: #153A5A;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    outline: none;
}

.btn-success-custom:hover, .btn-success-custom:focus {
    background-color: #157347;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(25, 135, 84, 0.12);
    outline: none;
}

.btn-primary-custom:focus, .btn-success-custom:focus {
    box-shadow: 0 0 0 4px rgba(30, 78, 121, 0.15);
}

.btn-light-custom {
    background-color: #f8f9fa;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-light-custom:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}*/

/* 輔助說明文字與錯誤訊息 */
/*.form-text, .text-danger {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}*/

/* 課表查詢/不開放時段遮罩 (無障礙處理) */
/*.period-disabled {
    background-color: #E2E8F0 !important;
    color: #94A3B8 !important;
    cursor: not-allowed;
    border-color: #CBD5E1 !important;
}*/

/* 全系統色彩強制修正：移除亮藍色，但排除按鈕內文字 */
/*a:not(.btn):not(.badge), .text-primary {
    text-decoration: none;
}

a:not(.btn):not(.badge):hover {
    color: #153A5A !important;
    text-decoration: underline;
}

.btn-primary, .badge-primary {
    background-color: #1E4E79 !important;
    border-color: #1E4E79 !important;
    color: #FFFFFF !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #153A5A !important;
    border-color: #153A5A !important;
}*/

/* 針對 DataTables 或其他元件的亮藍色分頁修正 */
/*.pagination > .active > a, 
.pagination > .active > span, 
.pagination > .active > a:hover, 
.pagination > .active > span:hover {
    background-color: #1E4E79 !important;
    border-color: #1E4E79 !important;
}*/

/* CSRS 後台套版：只調整視覺，不改變原本表單與資料表功能。 */
.admin-template-page {
    position: relative;
    padding-bottom: 72px;
}

.admin-template-page > * {
    position: relative;
    z-index: 1;
}

/* SweetAlert 提示必須高於固定導覽列、帳號選單與 Bootstrap 元件，避免送出後訊息被蓋住。 */
.swal2-container {
    z-index: 30000 !important;
}

.swal2-container.swal2-top-end,
.swal2-container.swal2-top-right {
    top: 126px !important;
    right: 28px !important;
}

.swal2-popup.swal2-toast {
    box-shadow: 0 14px 36px rgba(15, 23, 42, .18) !important;
}

/* Bootstrap modal 必須高於遮罩與固定導覽列，避免查看視窗被灰色 backdrop 蓋住。 */
.modal {
    z-index: 26000 !important;
}

.modal-backdrop {
    z-index: 25990 !important;
}

.account-detail-modal .modal-dialog {
    max-width: 640px;
}

.account-detail-modal .modal-content {
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #DDE8F7;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}

.account-detail-modal .modal-header {
    padding: 22px 26px;
    background: #F7FAFF;
    border-bottom: 1px solid #E2E8F0;
}

.account-detail-modal .modal-title {
    color: #0F172A;
    font-size: 1.35rem;
    font-weight: 800;
}

.account-detail-modal .modal-body {
    padding: 24px 26px;
}

.account-detail-modal .modal-footer {
    padding: 18px 26px 22px;
    background: #F8FAFE;
    border-top: 1px solid #E2E8F0;
}

.account-detail-modal .account-detail-list {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    column-gap: 24px;
    row-gap: 14px;
}

.account-detail-modal .account-detail-list dt,
.account-detail-modal .account-detail-list dd {
    margin: 0;
    width: auto;
    max-width: none;
    flex: none;
}

.account-detail-modal .account-detail-list dt {
    color: #475569;
    font-weight: 800;
    white-space: nowrap;
}

.account-detail-modal .account-detail-list dd {
    color: #111827;
    font-weight: 600;
    word-break: break-word;
}

.custom-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 53, 152, .08);
    padding: 28px;
}

.btn-primary-custom,
.btn-success-custom,
.btn-light-custom {
    --bs-btn-padding-x: 22px;
    --bs-btn-padding-y: 10px;
    --bs-btn-border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}

.btn-primary-custom {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: #2A6CC5;
    --bs-btn-border-color: #2A6CC5;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #2359A1;
    --bs-btn-hover-border-color: #2359A1;
    --bs-btn-focus-shadow-rgb: 42, 108, 197;
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: #1F4F90;
    --bs-btn-active-border-color: #1F4F90;
    color: #FFFFFF !important;
    background-color: #2A6CC5 !important;
    border: 1px solid #2A6CC5 !important;
    box-shadow: 0 8px 22px rgba(42, 108, 197, .22);
}

.btn-success-custom {
    --bs-btn-color: #FFFFFF;
    --bs-btn-bg: #EA8A10;
    --bs-btn-border-color: #EA8A10;
    --bs-btn-hover-color: #FFFFFF;
    --bs-btn-hover-bg: #D97706;
    --bs-btn-hover-border-color: #D97706;
    --bs-btn-focus-shadow-rgb: 234, 138, 16;
    --bs-btn-active-color: #FFFFFF;
    --bs-btn-active-bg: #B85F00;
    --bs-btn-active-border-color: #B85F00;
    color: #FFFFFF !important;
    background-color: #EA8A10 !important;
    border: 1px solid #EA8A10 !important;
    box-shadow: 0 8px 22px rgba(234, 138, 16, .2);
}

.btn-light-custom {
    --bs-btn-color: #2A6CC5;
    --bs-btn-bg: #FFFFFF;
    --bs-btn-border-color: #BFD3F2;
    --bs-btn-hover-color: #1F5EAD;
    --bs-btn-hover-bg: #F2F7FF;
    --bs-btn-hover-border-color: #8FB5EA;
    --bs-btn-focus-shadow-rgb: 42, 108, 197;
    --bs-btn-active-color: #1F5EAD;
    --bs-btn-active-bg: #E8F1FF;
    --bs-btn-active-border-color: #8FB5EA;
    color: #2A6CC5 !important;
    background-color: #FFFFFF !important;
    border: 1px solid #BFD3F2 !important;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus,
.btn-primary-custom:active,
.btn-primary-custom.active {
    color: #FFFFFF !important;
    background-color: #2359A1 !important;
    border-color: #2359A1 !important;
}

.btn-success-custom:hover,
.btn-success-custom:focus,
.btn-success-custom:active,
.btn-success-custom.active {
    color: #FFFFFF !important;
    background-color: #D97706 !important;
    border-color: #D97706 !important;
}

.btn-light-custom:hover,
.btn-light-custom:focus,
.btn-light-custom:active,
.btn-light-custom.active {
    color: #1F5EAD !important;
    background-color: #F2F7FF !important;
    border-color: #8FB5EA !important;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus,
.btn-success-custom:hover,
.btn-success-custom:focus,
.btn-light-custom:hover,
.btn-light-custom:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(42, 108, 197, .18);
}

.admin-page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.admin-filter-card,
.admin-data-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 53, 152, .08);
}

.admin-filter-card {
    padding: 28px 30px;
    margin-bottom: 28px;
}

.admin-data-card {
    padding: 0;
    overflow: hidden;
}

.admin-data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 28px 18px;
    border-bottom: 1px solid #E2E8F0;
}

.admin-data-card-title {
    margin: 0;
    color: #1D4FBC;
    font-size: 1.35rem;
    font-weight: 800;
}

.admin-data-card-subtitle {
    margin: 6px 0 0;
    color: #64748B;
    font-size: 0.92rem;
}

.admin-data-card .table-responsive {
    padding: 0;
}

.admin-account-table-wrap {
    padding: 0 28px 22px !important;
}

.admin-account-table-wrap .table {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    overflow: hidden;
}

.admin-account-table-wrap .table thead th:nth-child(1),
.admin-account-table-wrap .table tbody td:nth-child(1) {
    width: 15%;
}

.admin-account-table-wrap .table thead th:nth-child(2),
.admin-account-table-wrap .table tbody td:nth-child(2) {
    width: 13%;
}

.admin-account-table-wrap .table thead th:nth-child(3),
.admin-account-table-wrap .table tbody td:nth-child(3) {
    width: 13%;
}

.admin-account-table-wrap .table thead th:nth-child(4),
.admin-account-table-wrap .table tbody td:nth-child(4) {
    width: 12%;
}

.admin-account-table-wrap .table thead th:nth-child(5),
.admin-account-table-wrap .table tbody td:nth-child(5) {
    width: 15%;
}

.admin-account-table-wrap .table thead th:nth-child(6),
.admin-account-table-wrap .table tbody td:nth-child(6) {
    width: 12%;
}

.admin-account-table-wrap .table thead th:last-child,
.admin-account-table-wrap .table tbody td:last-child {
    width: 20%;
}

.admin-account-table-wrap .table tbody td:last-child {
    overflow-wrap: normal;
}

.admin-account-table-wrap .table tbody td:last-child .d-flex {
    flex-wrap: nowrap;
    gap: 8px !important;
}

.admin-account-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
}

.admin-account-actions .btn {
    min-width: 42px;
    padding-right: 10px;
    padding-left: 10px;
    white-space: nowrap;
    overflow-wrap: normal;
}

.admin-account-actions form {
    display: inline-flex !important;
    margin: 0 !important;
}

.admin-table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 0 28px;
    border-bottom: 1px solid #E2E8F0;
}

.admin-table-page-size,
.admin-table-search {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #111827;
    font-weight: 500;
}

.admin-table-page-size .form-select {
    width: 86px;
}

.admin-table-search .form-control {
    width: 260px;
}

.admin-native-table {
    width: 100%;
    table-layout: fixed;
}

.admin-native-table th[data-sort] {
    cursor: pointer;
    position: relative;
    padding-right: 28px !important;
}

.admin-native-table th[data-sort]::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #CBD5E1;
    transform: translateY(-50%);
}

.admin-native-table th.sort-asc::after {
    border-top: 0;
    border-bottom: 8px solid #2A6CC5;
}

.admin-native-table th.sort-desc::after {
    border-top-color: #2A6CC5;
}

.admin-table-footer {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: center;
    gap: 12px;
    min-height: 112px;
    padding: 18px 28px 22px;
    border-top: 1px solid #E2E8F0;
    text-align: center;
}

.admin-table-info {
    color: #334155;
    font-size: 0.95rem;
    text-align: center;
}

.admin-table-pager {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    margin-inline: auto;
    text-align: center;
}

.admin-table-page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid #D8E2F0;
    border-radius: 8px;
    color: #1D4FBC;
    background: #fff;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
    white-space: nowrap;
}

.admin-table-page-wide {
    min-width: 80px;
    padding: 0 12px;
}

.admin-table-page-icon {
    min-width: 36px;
    color: #8A98AA;
    background: #F1F5F9;
}

.admin-table-page-btn.active {
    color: #fff;
    background: #2A6CC5;
    border-color: #2A6CC5;
    box-shadow: 0 8px 18px rgba(42, 108, 197, .24);
}

.admin-table-page-btn:not(:disabled):not(.active):hover {
    color: #1F5EAD;
    background: #F2F7FF;
    border-color: #B9D2F5;
}

.admin-table-page-btn:disabled {
    color: #9AA7B7;
    background: #E9EEF5;
    border-color: #E3EAF3;
    cursor: not-allowed;
    box-shadow: none;
}

.admin-table-page-ellipsis {
    color: #64748B;
    padding: 0 4px;
}

.admin-data-card .table {
    margin-bottom: 0;
    width: 100% !important;
    table-layout: fixed;
    font-size: 1rem;
}

.admin-data-card table.dataTable {
    width: 100% !important;
    max-width: none !important;
    table-layout: fixed;
}

.admin-data-card .table thead th {
    background: #F3F6FB;
    color: #334155;
    border-bottom: 0;
    padding: 20px 22px;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-data-card .table thead th:last-child,
.admin-data-card .table tbody td:last-child {
    width: 150px;
}

.admin-data-card .table tbody td {
    padding: 24px 22px;
    border-color: #E2E8F0;
    color: #111827;
    font-size: 1rem;
    line-height: 1.55;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.admin-data-card .table .small {
    font-size: 1rem !important;
}

.admin-data-card .table .extra-small {
    font-size: .95rem !important;
}

.admin-data-card .table .badge {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
}

.admin-data-card .table tbody tr:nth-child(even) {
    background: #F8FAFE;
}

.admin-data-card .table-hover tbody tr:hover {
    background-color: #F2F7FF !important;
}

.admin-filter-card .form-label {
    color: #111827;
    font-weight: 700;
}

.admin-filter-card .form-control,
.admin-filter-card .form-select,
.admin-data-card .form-control,
.admin-data-card .form-select {
    min-height: 42px;
    border: 1px solid #D8E2F0;
    border-radius: 8px;
}

.admin-filter-card .form-control:focus,
.admin-filter-card .form-select:focus,
.admin-data-card .form-control:focus,
.admin-data-card .form-select:focus {
    border-color: #2A6CC5;
    box-shadow: 0 0 0 4px rgba(42, 108, 197, .12);
}

.admin-empty-row {
    padding: 34px 20px !important;
    color: #64748B !important;
    text-align: center;
}

.admin-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: .95rem;
    font-weight: 700;
}

.admin-pill-success {
    color: #079455;
    background: #E4F7ED;
}

.admin-pill-muted {
    color: #64748B;
    background: #EEF2F7;
}

.admin-pill-warning {
    color: #B45309;
    background: #FFF4D6;
}

.admin-pill-danger {
    color: #D6322D;
    background: #FEECEC;
}

.admin-inline-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 991.98px) {
    .admin-data-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-page-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .admin-filter-card {
        padding: 22px;
    }

    .admin-table-tools {
        align-items: stretch;
        flex-direction: column;
        padding: 16px 18px;
    }

    .admin-table-footer {
        align-items: center !important;
        flex-direction: column;
        padding: 16px 18px;
    }

    .admin-table-page-size,
    .admin-table-search,
    .admin-table-search .form-control {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .admin-page-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
