/**
 * Quest4You - Notifications CSS
 * Estilos para o sistema de notificações
 */

/* ================================
   NOTIFICATION CONTAINER
   ================================ */
.notification-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
}

/* ================================
   NOTIFICATION BELL
   ================================ */
.notification-bell {
  position: relative;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell:hover {
  background: rgba(var(--primary-rgb), 0.1);
  transform: scale(1.1);
}

.notification-bell:active {
  transform: scale(0.95);
}

/* Bell Animation when unread */
.notification-bell.has-unread {
  animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  10% { transform: rotate(15deg); }
  20% { transform: rotate(-15deg); }
  30% { transform: rotate(10deg); }
  40% { transform: rotate(-10deg); }
  50% { transform: rotate(0); }
}

/* ================================
   NOTIFICATION BADGE
   ================================ */
.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #C41E3A, #8B0000);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(196, 30, 58, 0.4);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ================================
   NOTIFICATIONS PANEL
   ================================ */
.notifications-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--card-bg, #1a1a2e);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panel Header */
.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), transparent);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.notifications-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color, #fff);
}

.btn-mark-all-read {
  background: transparent;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
  color: var(--text-muted, #aaa);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-mark-all-read:hover {
  background: var(--primary-color, #C41E3A);
  color: white;
  border-color: var(--primary-color, #C41E3A);
}

/* Notifications List */
.notifications-list {
  max-height: 400px;
  overflow-y: auto;
}

.notifications-list::-webkit-scrollbar {
  width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
  background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* ================================
   NOTIFICATION ITEM
   ================================ */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.notification-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
}

.notification-item.unread {
  background: rgba(var(--primary-rgb), 0.05);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-color, #C41E3A), var(--secondary-color, #6B2D5C));
}

/* Notification Icon */
.notification-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--primary-rgb), 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

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

.notification-message {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-color, #fff);
  line-height: 1.4;
}

.notification-item.read .notification-message {
  color: var(--text-muted, #aaa);
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}

/* Unread Dot */
.notification-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-color, #C41E3A);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.5rem;
  box-shadow: 0 0 8px rgba(196, 30, 58, 0.5);
}

/* ================================
   EMPTY STATE
   ================================ */
.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted, #888);
}

.notification-empty span {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.notification-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* ================================
   MOBILE RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  .notifications-panel {
    position: fixed;
    top: 60px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 80px);
  }

  .notification-bell {
    font-size: 1.1rem;
    padding: 0.4rem;
  }

  .notification-badge {
    min-width: 16px;
    height: 16px;
    font-size: 0.6rem;
  }

  .notifications-list {
    max-height: calc(100vh - 180px);
  }

  .notification-item {
    padding: 0.875rem 1rem;
  }

  .notification-icon {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }
}

/* ================================
   DARK MODE ADJUSTMENTS
   ================================ */
@media (prefers-color-scheme: dark) {
  .notifications-panel {
    background: #1a1a2e;
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* ================================
   NOTIFICATION TOAST (for instant feedback)
   ================================ */
.notification-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--card-bg, #1a1a2e);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  border-left: 4px solid var(--primary-color, #C41E3A);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  animation: toastSlideIn 0.3s ease, toastSlideOut 0.3s ease 4.7s forwards;
  max-width: 350px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

.notification-toast .toast-icon {
  font-size: 1.5rem;
}

.notification-toast .toast-content {
  flex: 1;
}

.notification-toast .toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-color, #fff);
}

.notification-toast .toast-message {
  font-size: 0.85rem;
  color: var(--text-muted, #aaa);
}

.notification-toast .toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #888);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.notification-toast .toast-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .notification-toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* ================================
   BELL RINGING ANIMATION
   ================================ */
.notification-bell.bell-ringing {
  animation: bellRingIntense 0.5s ease-in-out 2;
}

@keyframes bellRingIntense {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(20deg); }
  30% { transform: rotate(-20deg); }
  45% { transform: rotate(15deg); }
  60% { transform: rotate(-15deg); }
  75% { transform: rotate(8deg); }
  90% { transform: rotate(-8deg); }
}

/* Toast hiding animation */
.notification-toast.toast-hiding {
  animation: toastSlideOut 0.3s ease forwards;
}

/* Multiple toasts stacking */
.notification-toast:nth-of-type(2) {
  top: 160px;
}

.notification-toast:nth-of-type(3) {
  top: 240px;
}

/* Toast cursor */
.notification-toast {
  cursor: pointer;
}

.notification-toast:hover {
  transform: translateX(-5px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

/* Type-specific toast colors */
.notification-toast[data-type="friend_request"] {
  border-left-color: #3b82f6;
}

.notification-toast[data-type="friend_accepted"] {
  border-left-color: #10b981;
}

.notification-toast[data-type="new_message"] {
  border-left-color: #8b5cf6;
}

.notification-toast[data-type="smart_match"] {
  border-left-color: #ec4899;
}

.notification-toast[data-type="badge_earned"] {
  border-left-color: #f59e0b;
}

/* ================================
   PUSH NOTIFICATION PROMPT
   ================================ */
.push-notif-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 16px 20px;
  z-index: 10000;
  animation: slideUpFade 0.4s ease;
  max-width: calc(100vw - 40px);
  width: 400px;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.push-notif-prompt.hiding {
  animation: slideDownFade 0.3s ease forwards;
}

@keyframes slideDownFade {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

.push-prompt-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.push-prompt-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.push-prompt-text {
  flex: 1;
}

.push-prompt-text strong {
  display: block;
  color: var(--text-dark, #1a1a2e);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.push-prompt-text p {
  color: var(--text-light, #666);
  font-size: 0.8rem;
  margin: 0;
}

.push-prompt-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.push-prompt-actions .btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

@media (max-width: 500px) {
  .push-prompt-content {
    flex-wrap: wrap;
  }
  
  .push-prompt-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }
}
