/* 通知系統樣式 - 適用於 notifications-widget.js */

/* 通知容器樣式 - 確保不影響頁面布局 */
#notif-container { 
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9999;
    pointer-events: none;
}

#notif-container > * {
    pointer-events: auto;
}

/* 沉浸式閱讀模式背景遮罩 */
.notif-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 2147482999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.notif-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* 通知元件基本樣式 */
.notif-root { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif; 
}

.notif-bell { 
    cursor: pointer; 
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-family: inherit;
}

.notif-bell:hover { 
    background: #f7f7f7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notif-bell:active {
    transform: scale(0.95);
}

.notif-count {
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 4px;
}

/* 通知列表 */
.notif-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 列表頭部 */
.notif-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.notif-last-update {
    font-size: 12px;
    color: #888;
    transition: all 0.3s ease;
}

.notif-read-all {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #007bff;
    border-radius: 4px;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-read-all:hover {
    background: #0056b3;
    border-color: #0056b3;
}

/* 列表內容區域 */
.notif-list-content {
    flex: 1;
    overflow-y: auto;
}

/* 通知詳細內容面板 */
.notif-detail {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}
/* 詳細面板可滾動內容區域 */
.notif-detail-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 0;
}

/* 通知項目 */
.notif-item { 
    border-bottom: 1px solid #eee; 
    padding: 10px 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-left 0.2s ease;
    border-left: 4px solid transparent;
}

.notif-item:hover {
    background: #f8f9fa;
}

.notif-item:active {
    background: #e8f1ff;
}

.notif-item:last-child {
    border-bottom: none;
}

/* 選中狀態 */
.notif-item-active {
    background: #e3f2fd !important;
    border-left: 4px solid #007bff !important;
}

.notif-item-active:hover {
    background: #e3f2fd;
}

.notif-title { 
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

/* 詳細內容樣式 */
.notif-detail-content { 
    white-space: pre-wrap; 
    line-height: 1.8;
    color: #333;
    font-size: 15px;
    min-height: 100px;
    margin-bottom: 24px;
    word-break: break-word;
}

/* 詳細內容中的段落和標題 */
.notif-detail-content p {
    margin: 0 0 12px 0;
}

.notif-detail-content h1,
.notif-detail-content h2,
.notif-detail-content h3,
.notif-detail-content h4,
.notif-detail-content h5,
.notif-detail-content h6 {
    margin: 16px 0 12px 0;
    font-weight: 600;
}

/* 響應式圖片樣式 */
.notif-detail-content .img-fluid,
.img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 詳細面板頂部標題欄 */
.notif-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #007bff;
}

.notif-detail-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    word-break: break-word;
}

/* 詳細面板導航信息 */
.notif-detail-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 12px;
    color: #666;
    margin-bottom: 12px;
    padding: 4px 0;
}

/* 載入中狀態 */
.notif-loading {
    color: #666;
    font-size: 14px;
    padding: 12px;
    text-align: center;
}

/* 空狀態 */
.notif-empty {
    color: #666;
    font-size: 14px;
    padding: 12px;
    text-align: center;
}

/* 詳細內容操作按鈕 */
.notif-detail-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
    z-index: 10;
}

.notif-detail-actions button {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

@media (max-width: 768px) {
    .notif-detail-actions button {
        padding: 12px 20px;
        font-size: 16px;
        flex: 1;
        min-height: 44px;
    }
}

.notif-detail-actions button:active {
    transform: scale(0.95);
}

.notif-detail-actions .notif-read {
    border: 1px solid #007bff;
    background: #007bff;
    color: #fff;
}

.notif-detail-actions .notif-read:hover {
    background: #0056b3;
    border-color: #0056b3;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
}

.notif-detail-actions button:not(.notif-read) {
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
}

.notif-detail-actions button:not(.notif-read):hover {
    background: #f8f9fa;
    border-color: #999;
}

/* 鍵盤快捷鍵提示 */
.notif-detail-shortcuts {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .notif-bell {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .notif-list {
        width: 90vw !important;
        max-width: 90vw !important;
        max-height: 50vh !important;
    }
    
    /* 手機上詳情面板改為底部全屏模態框 */
    .notif-detail {
        position: fixed !important;
        bottom: 0 !important;
        right: 0 !important;
        top: auto !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: 12px 12px 0 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-bottom: none !important;
        padding: 16px !important;
        overflow-y: auto !important;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15) !important;
    }
    
    /* 手機上標題欄 */
    .notif-detail-header {
        margin-bottom: 12px;
    }
    
    .notif-detail-header h3 {
        font-size: 16px;
    }
    
    /* 手機上操作按鈕 */
    .notif-detail-actions {
        padding: 16px !important;
        border-top: 1px solid #eee !important;
        gap: 12px !important;
    }
    
    .notif-detail-actions button {
        padding: 12px 20px !important;
        font-size: 16px !important;
        flex: 1 !important;
        min-height: 44px !important;
    }
    
    .notif-detail-shortcuts {
        display: none;
    }
}

/* 滾動條樣式 */
.notif-list::-webkit-scrollbar {
    width: 6px;
}

.notif-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.notif-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.notif-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}
