/**
 * Notification Center Styles
 */

/* Notification button in header - matches other header buttons */
.header-notification-btn {
  position: relative;
  appearance: none;
  border: 1px solid rgba(var(--primary-rgb, 13, 148, 136), 0.14);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary, #1B1C20);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.12s, background 0.2s;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.header-notification-btn:hover:not(:disabled) {
  border-color: rgba(var(--primary-rgb, 13, 148, 136), 0.28);
  box-shadow: 0 10px 22px rgba(27, 28, 32, 0.10);
  transform: translateY(-1px);
}

.header-notification-btn:active:not(:disabled) {
  transform: translateY(0);
}

.header-notification-btn:focus-visible {
  outline: none;
  box-shadow:
    0 10px 22px rgba(27, 28, 32, 0.10),
    0 0 0 4px rgba(var(--primary-rgb, 13, 148, 136), 0.16);
}

.header-notification-icon {
  width: 18px;
  height: 18px;
  color: var(--text-primary, #383A47);
  flex-shrink: 0;
}

/* Unread indicator dot */
.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--background);
  display: none;
}

.notification-badge.has-unread {
  display: block;
}

/* Notification dropdown panel */
.notification-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  /* Use solid white - don't rely on CSS variables that might be transparent */
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  overflow: hidden;
  display: none;
}

.notification-panel.open {
  display: block;
}

/* Panel header */
.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.notification-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Header action buttons */
.notification-header-actions {
  display: flex;
  gap: 4px;
}

.notification-action-btn {
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.notification-action-btn:hover {
  background: var(--background-secondary);
}

.notification-action-btn:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.notification-action-btn.danger {
  color: var(--error, #dc2626);
}

.notification-action-btn.danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

.notification-action-btn.danger:disabled {
  color: var(--text-muted);
}

/* Notification list */
.notification-list {
  max-height: 400px;
  overflow-y: auto;
}

/* Individual notification item */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.notification-item:hover {
  background: var(--background-secondary);
}

.notification-item.unread {
  background: rgba(13, 148, 136, 0.05);
}

.notification-item.unread:hover {
  background: rgba(13, 148, 136, 0.08);
}

/* Notification icon */
.notification-item-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
}

.notification-item-icon.file_processed {
  background: #d1fae5;
  color: #059669;
}

.notification-item-icon.file_failed {
  background: #fee2e2;
  color: #dc2626;
}

.notification-item-icon.document_generated {
  background: #e0f2fe;
  color: #0284c7;
}

.notification-item-icon.conflict_detected {
  background: #fef3c7;
  color: #d97706;
}

.notification-item-icon.team_member_joined {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Notification content */
.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notification-item-message {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Unread dot on item */
.notification-item.unread .notification-item-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

/* Empty state */
.notification-empty {
  padding: 40px 20px;
  text-align: center;
}

.notification-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-muted);
}

.notification-empty-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.notification-empty-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Loading state */
.notification-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

/* Dark theme support - match header button styling */
[data-theme="dark"] .header-notification-btn,
html[data-theme="dark"] .header-notification-btn {
  background: rgba(15, 23, 42, 0.25);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .header-notification-btn:hover:not(:disabled),
html[data-theme="dark"] .header-notification-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(51, 65, 85, 0.92);
}

[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .notification-panel {
  background: var(--background-dark, #1e293b);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .header-notification-btn {
    width: 34px;
    height: 34px;
  }

  .header-notification-icon {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .notification-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
  }
}
