﻿/* ===== 元件和特殊樣式 ===== */

/* 時間軸樣式（用於狀態歷史） */
.timeline {
    position: relative;
    padding-left: 2rem;
}

    .timeline::before {
        content: '';
        position: absolute;
        left: 0.75rem;
        top: 0;
        bottom: 0;
        width: 2px;
        background: #dee2e6;
    }

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

    .timeline-item:last-child {
        margin-bottom: 0;
    }

.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background: #1b6ec2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.5rem;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-content {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    border-left: 3px solid #1b6ec2;
}

    .timeline-content h6 {
        margin-bottom: 0.5rem;
        color: #495057;
    }

    .timeline-content p {
        margin-bottom: 0.5rem;
    }

    .timeline-content .badge {
        font-size: 0.7rem;
    }

/* 單位樹狀結構樣式 */
.department-tree {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.department-node {
    margin: 5px 0;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .department-node:hover {
        background-color: #f8f9fa;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .department-node.selected {
        background-color: #e3f2fd;
        border-left: 4px solid #2196f3;
    }

.department-info {
    padding: 4px 0;
}

.department-stats {
    font-size: 0.85em;
    color: #6c757d;
}

.tree-toggle {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    margin-right: 5px;
}

.tree-children {
    margin-left: 25px;
    border-left: 2px dashed #dee2e6;
    padding-left: 15px;
}

/* 單位預覽樣式 */
.department-preview {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
}

/* 使用者選擇元件 */
.user-item {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .user-item:hover {
        background-color: #f8f9fa;
    }

    .user-item.selected {
        background-color: #e3f2fd;
        border-left: 3px solid #2196f3;
    }

.selected-user-badge {
    display: inline-block;
    margin: 2px;
    padding: 6px 12px;
    background-color: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 20px;
    font-size: 0.875em;
}

    .selected-user-badge .remove-btn {
        margin-left: 8px;
        color: #dc3545;
        cursor: pointer;
        font-weight: bold;
    }

/* 變更項目樣式 */
.change-item {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.change-field {
    font-weight: bold;
    color: #856404;
}

.change-old {
    color: #dc3545;
    text-decoration: line-through;
}

.change-new {
    color: #28a745;
    font-weight: bold;
}

/* 表單修改指示 */
.form-modified {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

/* 過期權限樣式 */
.permission-expired {
    opacity: 0.7;
    background-color: rgba(220, 53, 69, 0.1);
}

.permission-active {
    /* 正常顯示 */
}

/* 表格警告樣式 */
.table-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

/* 動畫效果 */
.fade-warning {
    animation: fadeWarning 3s ease-in-out;
}

@keyframes fadeWarning {
    0%, 100% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(255, 193, 7, 0.2);
    }
}

/* 輸入驗證樣式 */
.confirmation-input.valid {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.confirmation-input.invalid {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* 最小高度輔助類 */
.min-height-100 {
    min-height: 100px;
}

/* 模態框增強樣式 */
.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}


/* 顯示統計樣式 */
.display-6 {
    font-size: 2.5rem;
    font-weight: 600;
}

/* Canvas 圖表限制 */
canvas {
    max-height: 250px;
}

/* 卡片邊框特殊樣式 */
.card.border-danger {
    border-color: #dc3545 !important;
}

/* Alert 標題間距 */
.alert-heading {
    margin-bottom: 0.5rem;
}

/* 特殊內容框樣式 */
.bg-light {
    padding: 0.5rem;
    border-radius: 0.375rem;
}

/* 權限檢查狀態樣式 */
tr:has(.badge.bg-danger:contains("已過期")) {
    opacity: 0.7;
    background-color: rgba(220, 53, 69, 0.1);
}

/* 淡入動畫變體 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* 特殊響應式時間軸 */
@media (max-width: 768px) {
    .timeline::before {
        left: 15px;
    }

    .timeline-marker {
        left: 7px;
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .timeline-item {
        padding-left: 2.5rem;
    }

    .timeline-content {
        padding: 0.75rem;
    }
}

/* 頭像尺寸變體 */
.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-title {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* 特殊狀態指示 */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* 卡片 hover 動畫增強 */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

/* 特殊樣式工具類 */
.text-muted-light {
    color: #adb5bd !important;
}

.border-start-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-start-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-start-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-start-danger {
    border-left: 4px solid var(--danger-color) !important;
}
/*修正下拉選單*/
.card.dropdown-active {
    transform: none !important;
    box-shadow: var(--box-shadow) !important;
}