/* Same visual language as the sender dashboard in client/ */
:root {
  --font-family: 'Outfit', sans-serif;
  --bg-color: #0b0914;
  --card-bg: rgba(20, 16, 36, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-color: #8b5cf6;

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --failure: #f43f5e;
  --failure-glow: rgba(244, 63, 94, 0.2);
  --warning: #fbbf24;

  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

.glow-bg {
  position: absolute;
  top: -10%;
  left: 20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 50%, rgba(0, 0, 0, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
}

.header-title {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-pulse {
  width: 12px;
  height: 12px;
  background-color: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-color);
}

.app-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Connection status */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-offline {
  background: rgba(244, 63, 94, 0.1);
  color: var(--failure);
  border-color: rgba(244, 63, 94, 0.2);
}

.status-connecting {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.2);
}

.status-online {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-online .status-dot {
  animation: pulse-ring 1.5s infinite ease-out;
}

/* Layout */
.inbox {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  flex: 1;
}

.hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* User switcher */
.switcher-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.user-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.user-tab {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.9rem 0.55rem 0.55rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 40px;
  color: var(--text-primary);
  font-family: var(--font-family);
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.user-tab:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.3);
}

.user-tab:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.user-tab.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
}

.user-tab.active .avatar {
  background: var(--accent-color);
}

.user-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.user-email {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.unread {
  min-width: 20px;
  padding: 0.1rem 0.4rem;
  border-radius: 20px;
  background: var(--accent-color);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

/* Stale-connection banner */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fde68a;
  font-size: 0.85rem;
}

.banner[hidden] {
  display: none;
}

/* Buttons */
.btn {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--accent-color) 0%, #6366f1 100%);
  color: #fff;
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn:hover {
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  color: #fff;
}

/* Feed */
.feed-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.feed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.feed-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.notification {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 4px solid var(--accent-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  animation: slide-up-fade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.notification.delivered {
  border-left-color: var(--success);
}

.notification.dead {
  border-left-color: var(--failure);
}

.notification-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.notification-title {
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.notification-badge {
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.notification.delivered .notification-badge {
  background: var(--success-glow);
  color: #34d399;
}

.notification.dead .notification-badge {
  background: var(--failure-glow);
  color: #fb7185;
}

.notification-message {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notification-error {
  font-size: 0.8rem;
  color: #fda4af;
  overflow-wrap: anywhere;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state[hidden] {
  display: none;
}

.empty-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 0.8rem;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 340px;
}

/* Footer */
.app-footer {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes slide-up-fade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notification,
  .status-online .status-dot {
    animation: none;
  }
}
