/* Base styles */
body {
    font-size: 12px;
}

/* Form elements */
.form-control,
.form-select,
.input-group {
    font-size: 12px;
    height: 30px;
    border-radius: 5px;
}

/* Button styles */
.btn {
    font-size: 12px;
    height: 30px;
    border-radius: 5px;
}

.btn-primary {
    background-color: #3A6FAC;
    border-color: #3A6FAC;
}

.btn-primary:hover {
    background-color: #326095;
    border-color: #326095;
}

.btn-outline-primary {
    color: #3A6FAC;
    border-color: #3A6FAC;
}

.btn-outline-primary:hover {
    background-color: #326095;
    border-color: #326095;
}

/* Tag system styles */
.tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background-color: #dddddd;
    color: #000000;
    display: inline-flex;
    align-items: center;
    margin: 2px;
    cursor: pointer;
    gap: 4px;
}

.tag .remove-icon {
    color: #a1a1a1;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.tag.loyal {
    background-color: #dddddd;
    color: #000000;
}

.tag.blacklist {
    background-color: #f23e3e;
    color: #000000;
}

.tag.disabled {
    background-color: #dddddd;
    color: #000000;
}

.tag.premium {
    background-color: #07E8F9;
    color: #000000;
}

.tag-price-increase {
    background-color: #dc3545;
    color: #ffffff;
    border: 1px solid #dc3545;
}

.tag-selected {
    border: 1px solid #0d6efd;
    background-color: #e7f3ff;
}

.tag-price-increase.tag-selected {
    border-color: #b02a37;
    background-color: #c82333;
    color: #ffffff;
}

.badge-price-increase {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.add-tag-btn {
    width: 16px;
    height: 16px;
    border-radius: 12px;
    border: 1px solid #666;
    background: none;
    color: #666;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0px;
}

.add-tag-btn:hover {
    border-color: #666;
    color: #333;
}

.tags-popup {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 8px;
    z-index: 1000;
    width: 200px;
    height: 200px;
    margin-top: 5px;
    left: 0;
    overflow-y: auto;
    display: none;
}

.tags-popup.show {
    display: block;
}

.tags-popup::-webkit-scrollbar {
    width: 6px;
}

.tags-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.tags-popup::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.tags-popup::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 狀態標籤基本樣式（繼承自全域tag樣式） */
.tag-active {
    background-color: #F7D15F !important; /* 黃色表示啟用 */
    color: #000000 !important;
}

.tag-expired {
    background-color: #dddddd !important; /* 灰色表示關閉（與地區tag相同） */
    color: #000000 !important;
}

/* Table styles */
.table thead th {
    background-color: #DADADA;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

.table>:not(caption)>*>* {
    background-color: var(--bs-table-bg);
}

/* Sidebar styles */
.sidebar {
    width: 160px;
    /* Sidebar width */
    font-size: 16px;
    transition: width 0.3s ease; /* 平滑過渡效果 */
}

.sidebar.collapsed {
    width: 30px; /* 收合後的寬度 - 更新 */
}

.sidebar.collapsed .nav-link span {
    display: none; /* 收合時隱藏文字 */
}

.sidebar.collapsed .nav-link i {
    margin-right: 0; /* 收合時移除圖標右邊距 */
}

.sidebar-toggle-container {
    position: absolute;
    bottom: 5%;
    right: 0px;
    box-sizing: border-box;
    display: flex; /* 用於居中圖標按鈕 */
    justify-content: end;
    align-items: center; /* 垂直居中 */
}

#sidebarToggle {
    padding-left: 2px;
    padding-right: 0px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    border-right: none;
}

.content {
    height: calc(100vh - 70px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 0px 20px;
    padding-top: 10px;
    /* Additional space below the navbar */
    transition: margin-left 0.3s ease; /* 平滑過渡效果 */
}

/* Larger screens - sidebar is fixed and content has margin */
@media (min-width: 992px) {
    .navbar-brand {
        padding-top: .75rem;
        padding-bottom: .75rem;
    }

    .sidebar {
        position: fixed;
        top: 50px;
        /* Adjust based on header height */
        bottom: 0;
        left: 0;
        z-index: 1000;
        padding: 4px 0px 0px 0px;
        background-color: #1d1d1d !important;
        /* Dark background for sidebar */
        color: #fff;
        overflow-y: auto;
    }

    .content {
        margin-left: 160px;
        /* Same as sidebar width */
    }

    .content.sidebar-collapsed {
        margin-left: 30px; /* 收合後主內容的左邊距 - 更新 */
    }

    .navbar-toggler {
        display: none;
        /* Hide toggler on large screens */
    }

    .offcanvas-lg .offcanvas-body {
        display: block;
    }
}

/* Smaller screens - sidebar is offcanvas */
@media (max-width: 991.98px) {

    .sidebar.offcanvas-lg {
        /* Target the responsive offcanvas class */
        --bs-offcanvas-bg: #1d1d1d;
        /* Use Bootstrap CSS var to set dark background */
    }

    /* Ensure text elements within the offcanvas are white for readability */
    .sidebar.offcanvas-lg .offcanvas-header .offcanvas-title,
    .sidebar.offcanvas-lg .offcanvas-body .nav-link,
    .sidebar.offcanvas-lg .sidebar-toggle-container .btn { /*確保切換按鈕文字也是白色*/
        color: #fff !important;
        /* Important to override other text color classes like text-secondary */
    }

    /* Ensure the active nav link also maintains white text if Bootstrap tries to change it */
    .sidebar.offcanvas-lg .offcanvas-body .nav-link.active {
        color: #fff !important;
    }

    .content {
        margin-left: 0;
        /* Full width content on small screens */
    }
}

.navbar {
    z-index: 1030;
    /* Ensure header is above sidebar/offcanvas */
    transition: width 0.3s ease, left 0.3s ease; /* 平滑過渡效果 */
}

/* Navbar styles */

.navbar-toggler-icon {
    width: 1.2em;
    height: 1.2em;
}

.navbar-toggler {
    padding: 0.25rem;
    box-shadow: none !important;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

/* Badge styles */
.badge {
    border-radius: 0.5rem;
}

.badge-role {
    background-color: #dc3545;
    margin-left: 0.5rem;
}

.badge-new {
    background-color: #0d6efd;
    margin-left: 0.5rem;
}

.badge-booked {
    background-color: #6c757d;
    margin-left: 0.5rem;
}

/* Sortable styles */
.sortable-chosen {
    background: #ffeeba !important;
}

.sortable-ghost {
    opacity: 0.4;
}

/* Icon styles */
.bi {
    display: inline-block;
    width: 1rem;
    height: 1rem;
}

/* Input group styles */
.input-group button i {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    font-size: 1.0rem;
    vertical-align: middle;
}

.bg-dark {
    background-color: #1d1d1d !important;
}

.nav-link.active {
    background-color: #495057;
    font-weight: bold;
}

.table thead th {
    background-color: #DADADA;
}

.badge-role {
    background-color: #dc3545;
    margin-left: 0.5rem;
}

.badge-new {
    background-color: #0d6efd;
    margin-left: 0.5rem;
}

.badge-booked {
    background-color: #6c757d;
    margin-left: 0.5rem;
}

/* WKND Modal Styles */
.wknd-modal-header {
    background-color: #DADADA;
    height: 44px;
    padding: 0 1rem;
    display: flex;
    /* Added for proper alignment of close button */
    align-items: center;
    /* Added for proper alignment of close button */
}

.wknd-modal-title {
    margin: 0;
    width: 100%;
    text-align: center;
    font-size: 1rem;
    /* Matching h6, but can be adjusted */
}

.wknd-modal-footer {
    justify-content: center;
    border-top: none !important;
    /* Override Bootstrap's default border */
}

/* ===== 勾選框樣式 ===== */
.wkndbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid #aaa;
    border-radius: 2px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
    color: transparent;
}

/* 打勾（✔）樣式 */
.wkndbox.checked {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.wkndbox.checked::before {
    content: "✔";
    font-weight: bold;
}

/* 打 X（✖）樣式 */
.wkndbox.x-mark {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.wkndbox.x-mark::before {
    content: "✖";
    font-weight: bold;
}

/* Navbar styles - Fixed and verified */
.navbar.fixed-top {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 1030 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    height: 50px;
}

#header-container {
    height: 50px;
}

.navbar-dark.bg-dark {
    background-color: #1d1d1d !important;
}

/* Nav link styles */
.nav-link {
    height: 60px;
    display: flex;
    align-items: center;
}

/* Nav item styles */
#sidebar-container .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Styles for sidebar text when not collapsed */
.sidebar:not(.collapsed) .nav-link span {
    margin-left: 8px; /* 展開時圖標和文字的間距 */
}

/* Manager name display styles */
#manager-name-display {
    font-size: 12px;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Language selector styles */
.language-selector-container {
    margin-left: 1rem;
}

.language-selector-container .dropdown-menu {
    min-width: 8rem;
}

.language-selector-container .dropdown-item.active {
    background-color: #0d6efd;
    color: white;
}

.current-language-display {
    margin-top: 0.25rem;
    text-align: center;
    font-size: 0.75rem;
}
