/**
 * 系統通知樣式
 * 用於全域通知系統的 UI 元件
 */

/* ========== Toast 通知樣式 ========== */
.notification-toast-container {
    margin-top: 60px !important; /* 調整 Toast 位置，避免蓋到 header */
}

.notification-toast-container .swal2-popup {
    border-left: 4px solid #17a2b8; /* 添加左側藍色邊框 */
}

.notification-toast-container .swal2-popup:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important; /* 懸停時增強陰影效果 */
}

/* ========== 鈴鐺圖標樣式 ========== */
.notification-dropdown .fa-bell {
    font-size: 1.2rem;
    transition: color 0.2s;
}

.notification-dropdown .fa-bell:hover {
    color: #007bff !important;
}

/* ========== 徽章樣式 ========== */
#notificationBadge {
    font-size: 0.7rem;
    padding: 0.25em 0.4em;
    border-radius: 50%;
    min-width: 1.2em;
}

/* ========== 下拉選單樣式 ========== */
.notification-dropdown {
    position: relative;
}

.notification-menu {
    min-width: 350px;
    max-width: 400px;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    top: 100% !important;
    margin-top: 0.5rem;
}

.notification-menu .dropdown-header {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
}

/* ========== 通知項目樣式 ========== */
.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

/* 根據通知類型顯示不同的左側邊框顏色 */
.notification-item.notification-type-info {
    border-left-color: #17a2b8;
}

.notification-item.notification-type-success {
    border-left-color: #28a745;
}

.notification-item.notification-type-warning {
    border-left-color: #ffc107;
}

.notification-item.notification-type-error {
    border-left-color: #dc3545;
}

/* ========== 通知內容樣式 ========== */
.notification-title {
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.notification-content {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    max-height: 3.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 0.8rem;
    color: #adb5bd;
}

/* ========== 空狀態樣式 ========== */
.notification-menu .text-muted.py-3 {
    font-size: 0.9rem;
}

/* ========== 通知管理頁面樣式 ========== */
.notification-card {
    margin-bottom: 1rem;
    border-left: 4px solid #6c757d;
    transition: box-shadow 0.2s;
}

.notification-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-card.type-info {
    border-left-color: #17a2b8;
}

.notification-card.type-success {
    border-left-color: #28a745;
}

.notification-card.type-warning {
    border-left-color: #ffc107;
}

.notification-card.type-error {
    border-left-color: #dc3545;
}

.notification-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.notification-stats .stat-item {
    flex: 1;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    text-align: center;
}

.notification-stats .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.notification-stats .stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

/* ========== 表單樣式 ========== */
.notification-form .form-label {
    font-weight: 600;
    color: #495057;
}

.notification-form .form-control:focus,
.notification-form .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========== 響應式設計 ========== */
@media (max-width: 576px) {
    .notification-menu {
        min-width: 300px;
        max-width: 100%;
    }

    .notification-content {
        font-size: 0.8rem;
    }

    .notification-title {
        font-size: 0.9rem;
    }
}

/* ========== 動畫效果 ========== */
@keyframes bell-ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-10deg);
    }
    20%, 40% {
        transform: rotate(10deg);
    }
}

.notification-dropdown .fa-bell.ringing {
    animation: bell-ring 0.5s ease-in-out;
}
