/**
 * Notifications CSS Component
 * Stile per le notifiche a comparsa da mostrare all'utente
 */

/* Stili per le notifiche toast */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 350px;
  width: 100%;
}

.notification {
  margin-bottom: 15px;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
  transform: translateX(110%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  color: #fff;
  font-weight: 500;
  max-width: 100%;
}

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

.notification-icon {
  margin-right: 12px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.notification-close {
  margin-left: 10px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

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

/* Tipi di notifiche toast */
.notification-success {
  background-color: #4CAF50;
  border-left: 5px solid #388E3C;
}

.notification-error {
  background-color: #F44336;
  border-left: 5px solid #D32F2F;
}

.notification-warning {
  background-color: #FF9800;
  border-left: 5px solid #F57C00;
}

.notification-info {
  background-color: #2196F3;
  border-left: 5px solid #1976D2;
}

/* Animazione di entrata e uscita */
@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

.notification.slide-in {
  animation: slideInRight 0.4s forwards;
}

.notification.slide-out {
  animation: slideOutRight 0.4s forwards;
}

/* Stili per la pagina delle notifiche */
.notification-list {
  margin-bottom: 1.5rem;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  margin-bottom: 10px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

.notification-item:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.notification-item.unread {
  background-color: #f5f9ff;
  border-left: 4px solid #2196F3;
}

.notification-avatar {
  width: 48px;
  height: 48px;
  margin-right: 15px;
  flex-shrink: 0;
}

.notification-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.notification-avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #e1e5e9;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}

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

.notification-message {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.notification-time {
  font-size: 13px;
  color: #adb5bd;
}

.notification-actions {
  display: flex;
  gap: 5px;
  margin-left: 10px;
}

.notification-actions .btn {
  padding: 5px;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  background-color: transparent;
  transition: all 0.2s ease;
}

.notification-actions .btn:hover {
  background-color: rgba(108, 117, 125, 0.1);
}

.notification-actions .btn.mark-as-read {
  color: #2196F3;
}

.notification-actions .btn.mark-as-read:hover {
  background-color: rgba(33, 150, 243, 0.1);
}

.notification-actions .btn.delete-notification {
  color: #dc3545;
}

.notification-actions .btn.delete-notification:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .notification-item {
    padding: 12px;
  }
  
  .notification-avatar {
    width: 40px;
    height: 40px;
    margin-right: 10px;
  }
  
  .notification-message {
    font-size: 14px;
  }
  
  .notification-time {
    font-size: 12px;
  }
  
  .notification-actions .btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
}

@media (max-width: 576px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }
  
  .notification-item {
    padding: 10px;
  }
  
  .notification-avatar {
    width: 36px;
    height: 36px;
    margin-right: 8px;
  }
}

/* Dropdown notifiche stile moderno */
.notification-header {
  position: relative;
  display: inline-block;
}
.notification-btn {
  background: none;
  border: none;
  position: relative;
  cursor: pointer;
  font-size: 22px;
}
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #F44336;
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.notification-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 36px;
  width: 340px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 1000;
  padding: 0;
}
.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 8px 18px;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.dropdown-header a {
  color: #2196F3;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.dropdown-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 0 0 0 0;
}
.dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f5f5f5;
  background: #fff;
  transition: background 0.2s;
}
.dropdown-item.unread {
  background: #f5f9ff;
}
.notif-icon {
  font-size: 22px;
  margin-top: 2px;
}
.notif-text {
  font-size: 15px;
  font-weight: 500;
  color: #222;
}
.notif-time {
  font-size: 13px;
  color: #adb5bd;
  margin-top: 2px;
}
.dropdown-footer {
  padding: 10px 18px;
  text-align: center;
  border-top: 1px solid #f0f0f0;
}
.dropdown-footer a {
  color: #2196F3;
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
}

/* --- Nuovo stile per notification card v2 migliorato --- */
.notification-page-container {
  /* Layout gestito dal sistema standard container/main-content */
}

.notification-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #3d4b5c;
  margin-bottom: 32px;
  text-align: left;
}

.page-title {
  font-size: 28px;
  color: #666;
  margin-bottom: 30px;
  font-weight: normal;
}

.notification-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.notification-card-v2 {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 0;
  margin-bottom: 0;
  overflow: hidden;
  transition: all 0.2s;
  border: 1px solid #f0f0f0;
}

.notification-card-v2:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-card-v2.unread {
  border-left: 4px solid #3ec6e0;
  background: #f8fcfd;
}

/* Colori delle barre laterali per tipi di notifica */
/* Sidebar colors for notification types */
.notification-card-v2.notification-success {
  border-left: 4px solid #28a745;
}

.notification-card-v2.notification-success.unread {
  background-color: #f8fff9;
  border-left: 4px solid #28a745;
}

.notification-card-v2.notification-danger {
  border-left: 4px solid #dc3545;
}

.notification-card-v2.notification-danger.unread {
  background-color: #fff8f8;
  border-left: 4px solid #dc3545;
}

.notification-card-v2.notification-warning {
  border-left: 4px solid #ffc107;
}

.notification-card-v2.notification-warning.unread {
  background-color: #fffbf0;
  border-left: 4px solid #ffc107;
}

.notification-card-v2.notification-info {
  border-left: 4px solid #17a2b8;
}

.notification-card-v2.notification-info.unread {
  background-color: #f0fdff;
  border-left: 4px solid #17a2b8;
}

.notification-card-v2.notification-default {
  border-left: 4px solid #6c757d;
}

.notification-card-v2.notification-default.unread {
  background-color: #f8f9fa;
  border-left: 4px solid #6c757d;
}

.notification-card-header {
  display: flex;
  align-items: flex-start;
  padding: 20px;
  gap: 16px;
}

.notification-avatar-v2 {
  width: 80px;
  min-height: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.notification-avatar-v2 img,
.notification-avatar-placeholder-v2 {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

/* Rimosso: definizione duplicata integrata sopra */

.notification-avatar-placeholder-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #6c757d;
  font-weight: 700;
  background: #e1e5e9;
}

/* Informazioni utente sotto l'avatar nelle notifiche */
/* User information under avatar in notifications */
.notification-user-info {
  margin-top: 8px;
  text-align: center;
  min-width: 48px;
}

.notification-user-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #3d4b5c;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.notification-user-city {
  font-size: 0.7rem;
  color: #6c757d;
  line-height: 1.1;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.notification-icon-v2 {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 16px;
  color: #6c757d;
}

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

.notification-main-message {
  font-size: 1rem;
  font-weight: 600;
  color: #3d4b5c;
  margin-bottom: 4px;
  line-height: 1.4;
}

.notification-details {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 6px;
  line-height: 1.3;
}

.notification-time {
  font-size: 0.85rem;
  color: #adb5bd;
}

.notification-actions-v2 {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.notification-action-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #f8f9fa;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  color: #6c757d;
  text-decoration: none;
}

.notification-action-btn:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}

.notification-action-btn.view-btn {
  color: #3ec6e0;
}

.notification-action-btn.view-btn:hover {
  background: #e6f7fa;
  color: #2ba3c0;
}

.notification-action-btn.mark-as-read {
  color: #28a745;
}

.notification-action-btn.mark-as-read:hover {
  background: #d4edda;
  color: #1e7e34;
}

.notification-action-btn.delete-notification {
  color: #dc3545;
}

.notification-action-btn.delete-notification:hover {
  background: #f8d7da;
  color: #bd2130;
}

/* Anteprima oggetto nelle notifiche */
.notification-item-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.preview-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.preview-info {
  flex: 1;
  min-width: 0;
}

.preview-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-empty {
  text-align: center;
  padding: 60px 0;
  color: #b0b8c1;
}

.notification-empty img {
  max-width: 120px;
  margin-bottom: 18px;
  opacity: 0.7;
}

.notification-empty h5 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #6c757d;
}

.notification-empty p {
  font-size: 0.95rem;
  color: #adb5bd;
}

/* Responsive design */
@media (max-width: 768px) {
  .notification-page-container {
    /* Layout gestito dal sistema standard container/main-content */
  }
  
  .notification-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }
  
  .notification-card-header {
    padding: 16px;
    gap: 12px;
  }
  
  .notification-avatar-v2 {
    width: 65px;
    min-height: 40px;
  }
  
  .notification-avatar-v2 img,
  .notification-avatar-placeholder-v2 {
    width: 40px;
    height: 40px;
  }
  
  .notification-user-name {
    font-size: 0.7rem;
    max-width: 65px;
  }
  
  .notification-user-city {
    font-size: 0.65rem;
    max-width: 65px;
  }
  
  .notification-icon-v2 {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  
  .notification-main-message {
    font-size: 0.95rem;
  }
  
  .notification-details {
    font-size: 0.85rem;
  }
  
  .notification-actions-v2 {
    flex-direction: column;
    gap: 4px;
  }
  
  .notification-action-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .notification-item-preview {
    padding: 12px 16px;
    gap: 10px;
  }
  
  .preview-image {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .notification-card-header {
    flex-wrap: wrap;
  }
  
  .notification-avatar-v2 {
    width: 60px;
    min-height: 35px;
  }
  
  .notification-avatar-v2 img,
  .notification-avatar-placeholder-v2 {
    width: 35px;
    height: 35px;
  }
  
  .notification-user-name {
    font-size: 0.65rem;
    max-width: 60px;
  }
  
  .notification-user-city {
    font-size: 0.6rem;
    max-width: 60px;
  }
  
  .notification-actions-v2 {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
    margin-top: 12px;
    margin-left: 0;
  }
} 