/**
 * Notification System Styles
 * Toast notifications, bell dropdown, and notification center
 */

/* =====================================================
   NOTIFICATION BELL (Header)
   ===================================================== */
.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.notification-bell:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-bell .bi-bell {
    font-size: 1.25rem;
    color: #fff;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-radius: 9px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4);
    animation: badge-pulse 2s infinite;
}

.notification-badge:empty,
.notification-badge.d-none {
    display: none;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* =====================================================
   NOTIFICATION DROPDOWN
   ===================================================== */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: none;
    overflow: hidden;
}

.notification-dropdown.show {
    display: block;
    animation: dropdown-slide 0.2s ease-out;
}

@keyframes dropdown-slide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a1c23, #2d3748);
    color: #fff;
}

.notification-dropdown-header h6 {
    margin: 0;
    font-weight: 600;
}

.notification-dropdown-header .mark-all-read {
    font-size: 0.8rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}

.notification-dropdown-header .mark-all-read:hover {
    color: #fff;
}

.notification-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}

.notification-dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.notification-dropdown-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.notification-dropdown-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.notification-dropdown-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.notification-dropdown-footer a {
    color: #0d6efd;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.notification-dropdown-footer a:hover {
    text-decoration: underline;
}

/* =====================================================
   NOTIFICATION ITEM
   ===================================================== */
.notification-item {
    display: flex;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

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

.notification-item.unread {
    background-color: #eff6ff;
    border-left: 3px solid #0d6efd;
}

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

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.notification-icon.info {
    background: linear-gradient(135deg, #cff4fc, #a5f3fc);
    color: #0891b2;
}

.notification-icon.success {
    background: linear-gradient(135deg, #d1e7dd, #bbf7d0);
    color: #16a34a;
}

.notification-icon.warning {
    background: linear-gradient(135deg, #fff3cd, #fef08a);
    color: #ca8a04;
}

.notification-icon.danger {
    background: linear-gradient(135deg, #f8d7da, #fecaca);
    color: #dc2626;
}

.notification-icon.announcement {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4f46e5;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.notification-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 360px;
}

.toast-notification {
    display: flex;
    align-items: flex-start;
    padding: 16px 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    animation: toast-slide-in 0.3s ease-out;
    border-left: 4px solid;
    min-width: 300px;
}

.toast-notification.hiding {
    animation: toast-slide-out 0.25s ease-in forwards;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-notification.info {
    border-left-color: #0dcaf0;
}

.toast-notification.success {
    border-left-color: #198754;
}

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

.toast-notification.danger {
    border-left-color: #dc3545;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
}

.toast-notification.info .toast-icon {
    background: #cff4fc;
    color: #0891b2;
}

.toast-notification.success .toast-icon {
    background: #d1e7dd;
    color: #198754;
}

.toast-notification.warning .toast-icon {
    background: #fff3cd;
    color: #ca8a04;
}

.toast-notification.danger .toast-icon {
    background: #f8d7da;
    color: #dc3545;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8rem;
    color: #64748b;
}

.toast-close {
    padding: 4px;
    margin: -4px -4px -4px 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    line-height: 1;
}

.toast-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    animation: toast-progress 5s linear forwards;
}

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* =====================================================
   NOTIFICATION CENTER PAGE
   ===================================================== */
.notification-center {
    max-width: 800px;
    margin: 0 auto;
}

.notification-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.notification-filter-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}

.notification-filter-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.notification-filter-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.notification-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.notification-list .notification-item {
    padding: 18px 24px;
}

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

.notification-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.notification-action-btn {
    padding: 6px 10px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.8rem;
}

.notification-action-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.notification-action-btn.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* =====================================================
   MOBILE RESPONSIVE
   ===================================================== */
@media (max-width: 576px) {
    .notification-dropdown {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 80px);
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast-notification {
        min-width: auto;
    }
}

/* =====================================================
   PREFERENCES PAGE
   ===================================================== */
.preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

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

.preference-info h6 {
    margin: 0 0 4px 0;
    font-weight: 600;
    color: #1e293b;
}

.preference-info p {
    margin: 0;
    font-size: 0.85rem;
    color: #64748b;
}

/* Custom toggle switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}
