﻿/* ===== 通知和 Toastr 樣式 ===== */

/* Toastr 客製化樣式 */
.toast-success {
    background-color: #51a351 !important;
}

.toast-error {
    background-color: #bd362f !important;
}

.toast-warning {
    background-color: #f89406 !important;
}

.toast-info {
    background-color: #2f96b4 !important;
}

/* 覆寫 Toastr 預設樣式以符合設計 */
#toast-container > div {
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#toast-container .toast-close-button {
    color: white;
    opacity: 0.8;
}

    #toast-container .toast-close-button:hover {
        opacity: 1;
    }

/* Toastr 響應式調整 */
@media (max-width: 768px) {
    #toast-container {
        width: auto !important;
        right: 12px !important;
        left: 12px !important;
    }

        #toast-container > div {
            width: auto !important;
            margin: 0 0 6px !important;
        }
}

/* 系統通知樣式 */
.notification-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    max-height: 450px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: none;
    overflow: hidden;
}

    .notification-panel.show {
        display: block;
        animation: slideInDown 0.3s ease-out;
    }

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-title {
    font-weight: 600;
    margin: 0;
    color: #495057;
}

.notification-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

    .notification-close:hover {
        background: rgba(108, 117, 125, 0.1);
        color: #495057;
    }

.notification-body {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

    .notification-item:hover {
        background-color: #f8f9fa;
    }

    .notification-item.unread {
        background-color: #e3f2fd;
        border-left: 4px solid #2196f3;
    }

    .notification-item:last-child {
        border-bottom: none;
    }

.notification-content {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 5px;
}

.notification-meta {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-time {
    font-style: italic;
}

.notification-type {
    background: #dee2e6;
    color: #495057;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

    .notification-type.urgent {
        background: #dc3545;
        color: white;
    }

    .notification-type.info {
        background: #17a2b8;
        color: white;
    }

    .notification-type.success {
        background: #28a745;
        color: white;
    }

    .notification-type.warning {
        background: #ffc107;
        color: #212529;
    }

/* 通知徽章 */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 空狀態樣式 */
.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

    .notification-empty i {
        font-size: 2rem;
        margin-bottom: 10px;
        opacity: 0.5;
    }

/* 通知動作按鈕 */
.notification-actions {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
}

.notification-action-btn {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .notification-action-btn:hover {
        background: #e9ecef;
        border-color: #adb5bd;
    }

    .notification-action-btn.primary {
        background: #007bff;
        color: white;
        border-color: #007bff;
    }

        .notification-action-btn.primary:hover {
            background: #0056b3;
            border-color: #0056b3;
        }

/* 浮動通知樣式 */
.floating-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1060;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.floating-notification.success {
    border-left-color: #28a745;
}

.floating-notification.error {
    border-left-color: #dc3545;
}

.floating-notification.warning {
    border-left-color: #ffc107;
}

.floating-notification.info {
    border-left-color: #17a2b8;
}

.floating-notification-header {
    padding: 12px 15px 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.floating-notification-title {
    font-weight: 600;
    margin: 0;
    color: #495057;
    font-size: 0.9rem;
}

.floating-notification-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    font-size: 1.1rem;
    line-height: 1;
}

.floating-notification-body {
    padding: 0 15px 12px;
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
}

.floating-notification-progress {
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.floating-notification-progress-bar {
    height: 100%;
    background: currentColor;
    width: 100%;
    animation: progressCountdown 5s linear forwards;
}

@keyframes progressCountdown {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* 響應式通知 */
@media (max-width: 768px) {
    .notification-panel {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }

    .floating-notification {
        max-width: calc(100vw - 40px);
        right: 20px;
    }
}

@media (max-width: 480px) {
    .notification-panel {
        top: 70px;
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }

    .floating-notification {
        top: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }
}

/* 印刷時隱藏通知 */
@media print {
    #toast-container,
    .notification-panel,
    .floating-notification {
        display: none !important;
    }
}
