/* Unified Notification System - NavilinkGlobal Theme */
/* Consistent styling for all notifications across the platform */

:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --success-color: #059669;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #3b82f6;
}

/* Top-Right Notifications - NavilinkGlobal Theme */
.centered-top-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    transform: translateX(0);
    background: white;
    color: #1f2937;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    min-width: 320px;
    max-width: 400px;
    text-align: left;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border: 2px solid;
    border-left-width: 4px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stacking for multiple notifications - first one stays on top */
.centered-top-notification:nth-of-type(1) {
    top: 20px;
}

.centered-top-notification:nth-of-type(2) {
    top: 100px;
}

.centered-top-notification:nth-of-type(3) {
    top: 180px;
}

.centered-top-notification:nth-of-type(4) {
    top: 260px;
}

.centered-top-notification:nth-of-type(5) {
    top: 340px;
}

.centered-top-notification.success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #059669;
    color: #064e3b;
}

.centered-top-notification.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #dc2626;
    color: #7f1d1d;
}

.centered-top-notification.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #f59e0b;
    color: #78350f;
}

.centered-top-notification.info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #3b82f6;
    color: #1e40af;
}

.centered-top-notification i {
    font-size: 22px;
    flex-shrink: 0;
}

.centered-top-notification.success i {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.centered-top-notification.error i {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.centered-top-notification.warning i {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.centered-top-notification.info i {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.centered-top-notification span {
    flex: 1;
    text-align: left;
    line-height: 1.4;
}

/* Show notification - slide in from right */
.centered-top-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Animation keyframes */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.centered-top-notification {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.centered-top-notification.hiding {
    animation: slideOutRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Close button for notifications */
.centered-top-notification::after {
    content: '\00d7';
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    font-weight: 300;
    color: currentColor;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.centered-top-notification:hover::after {
    opacity: 1;
}

/* Checkbox Validation Styling */
.form-check-input.is-invalid {
    outline: 3px solid rgba(220, 38, 38, 0.5) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15) !important;
}

.form-check-input.is-valid {
    outline: 3px solid rgba(5, 150, 105, 0.5) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15) !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .centered-top-notification {
        min-width: calc(100% - 40px);
        max-width: calc(100% - 40px);
        padding: 14px 20px;
        font-size: 13px;
        top: 20px !important;
        right: 20px;
        left: 20px;
    }

    .centered-top-notification i {
        font-size: 18px;
        width: 28px;
        height: 28px;
    }

    /* Mobile stacking */
    .centered-top-notification:nth-of-type(1) {
        top: 20px !important;
    }

    .centered-top-notification:nth-of-type(2) {
        top: 90px !important;
    }

    .centered-top-notification:nth-of-type(3) {
        top: 160px !important;
    }

    .centered-top-notification:nth-of-type(4) {
        top: 230px !important;
    }

    .centered-top-notification:nth-of-type(5) {
        top: 300px !important;
    }
}

/* Flash Message Consistency */
.alert {
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
}

.alert-success {
    background-color: rgba(5, 150, 105, 0.1);
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: rgba(220, 38, 38, 0.1);
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background-color: rgba(217, 119, 6, 0.1);
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--info-color);
    color: #1e40af;
}

/*Navbar Notification Bell and Badge */
.notification-btn {
    position: relative;
    cursor: pointer;
    padding: 8px 12px !important;
}

.notification-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #dc2626;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translate(25%, -25%);
}

/* Notification Dropdown Menu */
.notification-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid #e5e7eb;
    z-index: 10000;
    overflow: hidden;
}

.notification-dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-dropdown-header h6 {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    color: white !important;
}

.notification-dropdown-header small {
    color: white !important;
    font-weight: 500;
}

.notification-dropdown-body {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.notification-dropdown-body::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.notification-dropdown-item {
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    position: relative;
}

.notification-dropdown-item:hover {
    background-color: #f8fafc;
    transform: translateX(3px);
}

.notification-dropdown-item.unread {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border-left: 3px solid #3b82f6;
}

.notification-dropdown-item.unread:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
}

.notification-dropdown-item .notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-dropdown-item .notification-icon.success {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.15), rgba(16, 185, 129, 0.15));
    color: #059669;
    border: 2px solid rgba(5, 150, 105, 0.2);
}

.notification-dropdown-item .notification-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(29, 78, 216, 0.15));
    color: #1d4ed8;
    border: 2px solid rgba(59, 130, 246, 0.2);
}

.notification-dropdown-item .notification-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
    color: #d97706;
    border: 2px solid rgba(245, 158, 11, 0.2);
}

.notification-dropdown-item .notification-icon.error {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(239, 68, 68, 0.15));
    color: #dc2626;
    border: 2px solid rgba(220, 38, 38, 0.2);
}

.notification-dropdown-item .notification-content {
    flex: 1;
}

.notification-dropdown-item .notification-message {
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
    font-weight: 500;
    line-height: 1.5;
}

.notification-dropdown-item .notification-time {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.notification-dropdown-item .notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.notification-dropdown-item .notification-actions button {
    font-size: 12px;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: #3b82f6;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.notification-dropdown-item .notification-actions button:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.notification-dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f4f8 100%);
}

.notification-dropdown-footer a {
    color: #1e3a8a;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.notification-dropdown-footer a:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.notification-dropdown-body .text-center {
    padding: 40px 20px;
    color: #6b7280;
}

.notification-dropdown-body .text-center i {
    color: #d1d5db;
}

/* Mobile Responsive for Dropdown */
@media (max-width: 768px) {
    .notification-dropdown-menu {
        width: calc(100vw - 40px);
        right: -80px;
        max-height: 60vh;
    }
}

/* Fix notification settings modal positioning */
.custom-modal .modal-content {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
}

.custom-modal .modal-body {
    padding: 24px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
}

.custom-modal .form-check-label {
    display: block !important;
    text-align: left !important;
    padding-left: 8px !important;
}

.custom-modal .form-check-label small {
    display: block !important;
    margin-top: 4px !important;
    font-size: 12px !important;
    color: #6b7280 !important;
}

/* Themed close button - Red X with smooth animations */
.modal .btn-close,
.custom-modal .btn-close,
button.btn-close {
    background: transparent !important;
    border: none !important;
    opacity: 1 !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    position: relative !important;
    transition: all 0.3s ease !important;
    filter: none !important;
    background-image: none !important;
}

.modal .btn-close::before,
.modal .btn-close::after,
.custom-modal .btn-close::before,
.custom-modal .btn-close::after,
button.btn-close::before,
button.btn-close::after {
    content: '' !important;
    position: absolute !important;
    width: 20px !important;
    height: 2px !important;
    background-color: #dc2626 !important;
    top: 50% !important;
    left: 50% !important;
    transition: all 0.3s ease !important;
}

.modal .btn-close::before,
.custom-modal .btn-close::before,
button.btn-close::before {
    transform: translate(-50%, -50%) rotate(45deg) !important;
}

.modal .btn-close::after,
.custom-modal .btn-close::after,
button.btn-close::after {
    transform: translate(-50%, -50%) rotate(-45deg) !important;
}

.modal .btn-close:hover::before,
.modal .btn-close:hover::after,
.custom-modal .btn-close:hover::before,
.custom-modal .btn-close:hover::after,
button.btn-close:hover::before,
button.btn-close:hover::after {
    background-color: #991b1b !important;
}

.modal .btn-close:hover,
.custom-modal .btn-close:hover,
button.btn-close:hover {
    transform: rotate(90deg) scale(1.1) !important;
}

/* White X for dark modal headers */
.modal-header.bg-primary .btn-close::before,
.modal-header.bg-primary .btn-close::after,
.modal-header.bg-success .btn-close::before,
.modal-header.bg-success .btn-close::after,
.modal-header.bg-danger .btn-close::before,
.modal-header.bg-danger .btn-close::after,
.modal-header.bg-warning .btn-close::before,
.modal-header.bg-warning .btn-close::after,
.modal-header.bg-info .btn-close::before,
.modal-header.bg-info .btn-close::after,
.modal-header.bg-dark .btn-close::before,
.modal-header.bg-dark .btn-close::after {
    background-color: white !important;
}

.modal-header.bg-primary .btn-close:hover::before,
.modal-header.bg-primary .btn-close:hover::after,
.modal-header.bg-success .btn-close:hover::before,
.modal-header.bg-success .btn-close:hover::after,
.modal-header.bg-danger .btn-close:hover::before,
.modal-header.bg-danger .btn-close:hover::after,
.modal-header.bg-warning .btn-close:hover::before,
.modal-header.bg-warning .btn-close:hover::after,
.modal-header.bg-info .btn-close:hover::before,
.modal-header.bg-info .btn-close:hover::after,
.modal-header.bg-dark .btn-close:hover::before,
.modal-header.bg-dark .btn-close:hover::after {
    background-color: rgba(255, 255, 255, 0.8) !important;
}