/**
 * 3D ArtDesk - Realtime CSS
 * Styles pentru typing indicators, toasts, badges
 */

/* === BADGE PULSE ANIMATION === */
@keyframes badge-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.bell-badge.pulse,
.mention-badge.pulse,
.tab-badge.pulse {
  animation: badge-pulse 0.5s ease-out;
}

.bell-badge,
.mention-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.bell-btn,
#btnNotifications,
#btnMentions {
  position: relative;
}

/* === TYPING INDICATOR === */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f5f5f5);
  border-radius: 8px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--text-muted, #666);
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary, #667eea);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.typing-text {
  font-style: italic;
}

/* === TOAST CONTAINER === */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

/* === NOTIFICATION TOAST === */
.notification-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border-left: 4px solid var(--primary, #667eea);
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
}

.notification-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-toast:hover {
  transform: translateX(-5px);
  box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}

/* Toast types */
.notification-toast.type-task_assigned { border-left-color: #3498db; }
.notification-toast.type-mention { border-left-color: #9b59b6; }
.notification-toast.type-task_chat,
.notification-toast.type-project_chat { border-left-color: #2ecc71; }
.notification-toast.type-deadline_approaching { border-left-color: #e74c3c; }
.notification-toast.type-task_done { border-left-color: #27ae60; }

.toast-icon {
  font-size: 24px;
  line-height: 1;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.toast-context {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

.toast-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #e74c3c;
}

/* === NOTIFICATIONS MODAL === */
.notifications-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
}

.notifications-modal.open {
  display: flex;
}

.notif-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}

.notif-panel {
  position: relative;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: white;
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  animation: slide-in 0.3s ease;
}

@keyframes slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #eee);
}

.notif-header h3 {
  margin: 0;
  font-size: 18px;
}

.notif-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.notif-tabs {
  display: flex;
  padding: 0 16px;
  border-bottom: 1px solid var(--border, #eee);
  overflow-x: auto;
}

.notif-tab {
  padding: 12px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  transition: all 0.2s;
  position: relative;
}

.notif-tab:hover {
  color: var(--primary, #667eea);
}

.notif-tab.active {
  color: var(--primary, #667eea);
  border-bottom-color: var(--primary, #667eea);
  font-weight: 600;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #e74c3c;
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 9px;
  margin-left: 6px;
}

.tab-badge:empty {
  display: none;
}

.notif-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #eee);
}

.notif-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  font-size: 13px;
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

.notif-group {
  margin-bottom: 8px;
}

.notif-group-date {
  padding: 8px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.notif-item:hover {
  background: var(--bg-secondary, #f5f5f5);
}

.notif-item.unread {
  background: #f0f7ff;
}

.notif-item.unread:hover {
  background: #e5f0ff;
}

.notif-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #f0f0f0);
  border-radius: 8px;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 2px;
}

.notif-message {
  font-size: 13px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-context {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.notif-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: #999;
}

.notif-type {
  background: var(--bg-secondary, #f0f0f0);
  padding: 2px 6px;
  border-radius: 4px;
}

.notif-unread-dot {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--primary, #667eea);
  border-radius: 50%;
}

.notif-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border, #eee);
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* === BTN HELPERS === */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--bg-secondary, #f0f0f0);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-sm:hover {
  background: var(--border, #ddd);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: var(--bg-secondary, #f0f0f0);
}

/* === DRAFT INDICATOR === */
.draft-indicator {
  color: #f39c12;
  margin-left: 4px;
  font-size: 12px;
}

/* === MOBILE === */
@media (max-width: 480px) {
  .toast-container {
    left: 10px;
    right: 10px;
    max-width: none;
  }
  
  .notif-panel {
    width: 100vw;
  }
  
  .notif-tabs {
    padding: 0 8px;
  }
  
  .notif-tab {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
  .notification-toast {
    background: #2d2d2d;
  }
  
  .toast-title {
    color: #fff;
  }
  
  .toast-message {
    color: #aaa;
  }
  
  .notif-panel {
    background: #1a1a1a;
  }
  
  .notif-item.unread {
    background: #252535;
  }
  
  .notif-title {
    color: #fff;
  }
  
  .notif-message {
    color: #aaa;
  }
}
