/* --- NOTIFICATIONS SYSTEM STYLES (Premium CertiScore Theme) --- */

/* Modal Overlay & Card */
.modal-system-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.modal-system-overlay.hidden {
    display: none !important;
    opacity: 0;
}

.notifications-card {
    background: linear-gradient(145deg, #0e0e12 0%, #15151e 100%);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    max-width: 500px;
    width: 95%;
    overflow: hidden;
    animation: modalEntrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEntrance {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.notifications-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notifications-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.notifications-header-actions button {
    white-space: nowrap;
    flex-shrink: 0;
}

.notifications-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff !important;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.notifications-header h2 i {
    color: var(--bs-primary);
    /* Removed neon glow for cleaner look */
}

.btn-mark-all {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-mark-all:hover {
    background: rgba(var(--bs-primary-rgb), 0.15);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    transform: translateY(-2px);
}

.notifications-card .close-btn {
    position: absolute;
    top: 18px;
    right: 20px;
    background: rgba(255, 59, 48, 0.8);
    /* More visible red background */
    border: 1px solid rgba(255, 59, 48, 0.5);
    color: #ffffff !important;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 50;
}

.notifications-card .close-btn:hover {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30 !important;
    transform: rotate(90deg);
}

.notifications-body {
    padding: 24px;
    max-height: 550px;
    overflow-y: auto;
}

/* Loading & Empty States */
.notifications-loading,
.notifications-empty {
    text-align: center;
    padding: 80px 24px;
}

.notifications-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.notifications-empty i {
    font-size: 4.5rem;
    margin-bottom: 24px;
    opacity: 0.2;
    color: var(--bs-primary);
}

.notifications-empty p {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

/* Header Bell & Badge (Navigation) */
/* Header Bell & Badge (Navigation) */
.header-icon-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    position: relative;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    box-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.3);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--bs-primary);
    color: #000;
    font-size: 0.7rem;
    font-weight: 900;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    box-shadow: 0 0 12px rgba(var(--bs-primary-rgb), 0.6);
    animation: badge-pulse 2s infinite;
    z-index: 10;
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.4);
    }

    70% {
        transform: scale(1.15);
        box-shadow: 0 0 0 8px rgba(var(--bs-primary-rgb), 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }
}

/* Notifications List */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    /* Prevent text cut-off */
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.notification-item.unread {
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.08) 0%, rgba(var(--bs-primary-rgb), 0.02) 100%);
    border-color: rgba(var(--bs-primary-rgb), 0.25);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bs-primary);
    box-shadow: 0 0 10px var(--bs-primary);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-primary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex-grow: 1;
    min-width: 0;
    /* Crucial for text wrapping in flexbox */
}

.notification-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.notification-time {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    display: block;
}

/* Action Buttons */
.notification-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-accept,
.btn-decline {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.btn-accept {
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary) !important;
    border-color: rgba(var(--bs-primary-rgb), 0.2);
}

.btn-accept:hover {
    background: var(--bs-primary);
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.3);
}

.btn-decline {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30 !important;
    border-color: rgba(255, 59, 48, 0.2);
}

.btn-decline:hover {
    background: #ff3b30;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
}

/* Marker read button */
.mark-read-btn {
    background: none;
    border: none;
    color: var(--bs-primary);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.7;
    padding: 5px;
    transition: all 0.2s;
}

.mark-read-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

.btn-accept:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-view {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-view-small {
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--bs-primary) !important;
}

/* Mobile Responsive Adjustments for Header */
@media (max-width: 768px) {
    .header-icon-btn {
        font-size: 1.4rem;
        padding: 10px;
        margin-right: 10px;
    }
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    .notifications-card {
        border-radius: 20px;
        width: calc(100% - 24px);
        /* Fix overflow from 100% + margin */
        margin: 12px auto;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    .notifications-header {
        padding: 16px 20px;
    }

    .notifications-header h2 {
        font-size: 1.1rem;
    }

    .btn-mark-all {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .notifications-card .close-btn {
        width: 36px;
        /* Increased touch target */
        height: 36px;
        font-size: 1.1rem;
        background: rgba(255, 59, 48, 0.9) !important;
        /* Solid red */
        border: 1px solid #ff3b30;
        box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
    }

    .notifications-body {
        padding: 16px;
    }

    .notification-item {
        padding: 14px;
        gap: 12px;
        border-radius: 16px;
    }

    .notification-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        border-radius: 8px;
    }

    .notification-text {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }

    .notification-time {
        font-size: 0.75rem;
    }

    .notification-actions {
        margin-top: 8px;
        gap: 8px;
    }

    .btn-accept,
    .btn-decline {
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .btn-view {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}