/* === NOTIFICATION BELL DROPDOWN === */
.cc-notification-bell-wrap {
    position: relative;
    display: inline-flex;
}

.cc-notification-bell {
    position: relative;
    background: transparent;
    border: none;
    padding: var(--cc-space-2);
    cursor: pointer;
    color: var(--cc-topbar-text);
    border-radius: var(--cc-btn-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cc-notification-bell:hover {
    background: var(--cc-surface-muted);
}

.cc-notification-bell svg {
    width: 20px;
    height: 20px;
}

.cc-notification-bell:focus-visible {
    outline: 2px solid var(--cc-brand-primary);
    outline-offset: 2px;
}

/* The unread-count badge is only rendered server-side when count > 0,
   so this rule is responsible for shape/color only — the "show 0"
   bug came from the badge being emitted regardless of count. */
.cc-notification-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--cc-error);
    color: var(--cc-white);
    font-size: 10px;
    font-weight: var(--cc-weight-semibold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cc-notification-panel {
    position: absolute;
    top: calc(100% + var(--cc-space-2));
    right: 0;
    width: 360px;
    max-height: 480px;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-md);
    box-shadow: var(--cc-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 60;
}

.cc-notification-panel[hidden] {
    display: none;
}

.cc-notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--cc-space-3) var(--cc-space-4);
    border-bottom: 1px solid var(--cc-border);
}

.cc-notification-panel-title {
    font-weight: var(--cc-weight-semibold);
    color: var(--cc-text);
    font-size: var(--cc-text-sm);
}

.cc-notification-mark-all-form {
    margin: 0;
}

.cc-notification-mark-all {
    background: none;
    border: none;
    color: var(--cc-primary);
    font-size: var(--cc-text-xs);
    cursor: pointer;
    padding: 0;
}

.cc-notification-mark-all:hover {
    text-decoration: underline;
}

.cc-notification-empty {
    padding: var(--cc-space-6) var(--cc-space-4);
    text-align: center;
    color: var(--cc-text-muted);
}

.cc-notification-empty svg {
    width: 32px;
    height: 32px;
    color: var(--cc-success);
    margin-bottom: var(--cc-space-2);
}

.cc-notification-empty p {
    margin: 0;
    font-size: var(--cc-text-sm);
}

.cc-notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
}

.cc-notification-row {
    border-bottom: 1px solid var(--cc-border);
}

.cc-notification-row:last-child {
    border-bottom: none;
}

.cc-notification-row-form {
    margin: 0;
}

.cc-notification-row-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    gap: var(--cc-space-3);
    padding: var(--cc-space-3) var(--cc-space-4);
    color: var(--cc-text);
}

.cc-notification-row-btn:hover {
    background: var(--cc-surface-muted);
}

.cc-notification-unread .cc-notification-row-btn {
    background: var(--cc-surface-subtle, var(--cc-surface-muted));
}

.cc-notification-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    background: var(--cc-text-muted);
}

.cc-notification-dot-info { background: var(--cc-info, var(--cc-primary)); }
.cc-notification-dot-warning { background: var(--cc-warning); }
.cc-notification-dot-error { background: var(--cc-error); }
.cc-notification-dot-success { background: var(--cc-success); }
.cc-notification-dot-compliance { background: var(--cc-primary); }

.cc-notification-row-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.cc-notification-row-title {
    font-weight: var(--cc-weight-semibold);
    font-size: var(--cc-text-sm);
}

.cc-notification-row-message {
    font-size: var(--cc-text-xs);
    color: var(--cc-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cc-notification-row-time {
    font-size: var(--cc-text-xs);
    color: var(--cc-text-muted);
    margin-top: var(--cc-space-1);
}

.cc-notification-panel-footer {
    border-top: 1px solid var(--cc-border);
    padding: var(--cc-space-2) var(--cc-space-4);
    text-align: center;
}

.cc-notification-view-all {
    color: var(--cc-primary);
    font-size: var(--cc-text-sm);
    text-decoration: none;
}

.cc-notification-view-all:hover {
    text-decoration: underline;
}

/* === NOTIFICATIONS PAGE === */
.cc-notifications-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--cc-space-3);
    margin-bottom: var(--cc-space-4);
    flex-wrap: wrap;
}

.cc-notifications-filters {
    display: flex;
    gap: var(--cc-space-2);
}

.cc-notifications-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-md);
    overflow: hidden;
}

.cc-notifications-table th,
.cc-notifications-table td {
    padding: var(--cc-space-3) var(--cc-space-4);
    text-align: left;
    border-bottom: 1px solid var(--cc-border);
    font-size: var(--cc-text-sm);
}

.cc-notifications-table tr:last-child td {
    border-bottom: none;
}

.cc-notifications-table tr.cc-row-unread td {
    background: var(--cc-surface-subtle, var(--cc-surface-muted));
    font-weight: var(--cc-weight-semibold);
}

.cc-notifications-empty {
    padding: var(--cc-space-8) var(--cc-space-4);
    text-align: center;
    color: var(--cc-text-muted);
}

.cc-notifications-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--cc-space-4);
    gap: var(--cc-space-3);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cc-notification-panel {
        position: fixed;
        top: 60px;
        right: var(--cc-space-2);
        left: var(--cc-space-2);
        width: auto;
        max-height: calc(100vh - 80px);
    }

    .cc-notifications-table th:nth-child(3),
    .cc-notifications-table td:nth-child(3) {
        display: none;
    }
}
