/**
 * notification-styles.css
 * Mordheim Campaign Manager - Notification System Styling
 */

/* ===================================================================
   NOTIFICATION BELL (Header)
   =================================================================== */

.notification-bell-container {
  position: relative;
  margin-right: 15px;
}

.notification-bell {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-md, 6px);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  position: relative;
}

.notification-bell:hover {
  background: rgba(139, 0, 0, 0.2);
}

.notification-bell .bell-icon {
  font-size: 1.3rem;
  filter: grayscale(0.3);
  transition: filter 0.2s;
}

.notification-bell:hover .bell-icon {
  filter: grayscale(0);
  animation: bellShake 0.5s ease;
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(15deg); }
  50% { transform: rotate(-15deg); }
  75% { transform: rotate(10deg); }
}

/* Badge */
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f44336;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary, #1a1a1a);
  animation: badgePulse 2s infinite;
}

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

/* ===================================================================
   DROPDOWN
   =================================================================== */

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 380px;
  max-width: 95vw;
  background: var(--bg-card, #2a2a2a);
  border: 2px solid var(--color-blood, #8B0000);
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.notification-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(5px);
}

/* Dropdown Header */
.notification-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.3), rgba(139, 0, 0, 0.1));
  border-bottom: 1px solid var(--border-color, #3a3a3a);
}

.notification-dropdown-header h4 {
  margin: 0;
  color: var(--color-gold, #D4AF37);
  font-size: 1rem;
  font-family: var(--font-gothic, 'Cinzel', serif);
}

.mark-all-read-btn {
  background: transparent;
  border: 1px solid var(--border-color, #3a3a3a);
  color: var(--text-muted, #888);
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.mark-all-read-btn:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: #4CAF50;
  color: #4CAF50;
}

/* Dropdown Content */
.notification-dropdown-content {
  max-height: 400px;
  overflow-y: auto;
}

/* Individual Notification Item */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color, #3a3a3a);
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
  background: rgba(139, 0, 0, 0.1);
  border-left: 3px solid var(--color-blood, #8B0000);
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--color-blood, #8B0000);
  border-radius: 50%;
}

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

.notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

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

.notification-title {
  color: var(--text-primary, #e0e0e0);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-message {
  color: var(--text-secondary, #aaa);
  font-size: 0.85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  color: var(--text-muted, #666);
  font-size: 0.75rem;
  margin-top: 4px;
}

.notification-delete {
  background: transparent;
  border: none;
  color: var(--text-muted, #666);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0;
  transition: all 0.2s;
  border-radius: 4px;
}

.notification-item:hover .notification-delete {
  opacity: 1;
}

.notification-delete:hover {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

/* Empty State */
.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted, #666);
}

.notification-empty::before {
  content: '🔔';
  display: block;
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

/* More Link */
.notification-more-link {
  display: block;
  padding: 12px;
  text-align: center;
  color: var(--color-gold, #D4AF37);
  text-decoration: none;
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color, #3a3a3a);
  transition: background 0.2s;
}

.notification-more-link:hover {
  background: rgba(212, 175, 55, 0.1);
}

/* Dropdown Footer */
.notification-dropdown-footer {
  padding: 10px 15px;
  border-top: 1px solid var(--border-color, #3a3a3a);
  background: rgba(0, 0, 0, 0.2);
}

.notification-settings-link {
  color: var(--text-muted, #888);
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}

.notification-settings-link:hover {
  color: var(--color-gold, #D4AF37);
}

/* ===================================================================
   SETTINGS UI (Profile Page)
   =================================================================== */

.notification-settings {
  max-width: 700px;
}

.settings-section {
  background: var(--bg-card, #2a2a2a);
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: var(--radius-lg, 8px);
  padding: 20px;
  margin-bottom: 20px;
}

.settings-section h4 {
  color: var(--color-gold, #D4AF37);
  font-family: var(--font-gothic, 'Cinzel', serif);
  margin: 0 0 5px;
  font-size: 1.1rem;
}

.settings-description {
  color: var(--text-muted, #888);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.settings-group {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color, #3a3a3a);
}

.settings-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-group h5 {
  color: var(--text-primary, #e0e0e0);
  font-size: 0.95rem;
  margin: 0 0 12px;
}

/* Toggle Switches */
.setting-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 4px;
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
}

.setting-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.setting-toggle input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: var(--bg-secondary, #1a1a1a);
  border: 2px solid var(--border-color, #3a3a3a);
  border-radius: 12px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--text-muted, #666);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.3s ease;
}

.setting-toggle input:checked + .toggle-slider {
  background: rgba(76, 175, 80, 0.3);
  border-color: #4CAF50;
}

.setting-toggle input:checked + .toggle-slider::after {
  background: #4CAF50;
  left: 22px;
}

.toggle-label {
  color: var(--text-secondary, #aaa);
  font-size: 0.95rem;
}

.setting-toggle input:checked ~ .toggle-label {
  color: var(--text-primary, #e0e0e0);
}

/* Test Email Button */
.settings-test-email {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color, #3a3a3a);
}

/* Settings Actions */
.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===================================================================
   NOTIFICATION LIST (Profile Page - All Notifications)
   =================================================================== */

.notification-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #666);
}

.notification-empty-state .empty-icon {
  font-size: 4rem;
  opacity: 0.5;
  margin-bottom: 15px;
}

.notification-empty-state h3 {
  color: var(--text-primary, #e0e0e0);
  margin: 0 0 10px;
}

.notification-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  color: var(--text-muted, #888);
  font-size: 0.9rem;
}

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

.notification-list-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  background: var(--bg-card, #2a2a2a);
  border: 1px solid var(--border-color, #3a3a3a);
  border-radius: var(--radius-md, 6px);
  transition: all 0.2s;
}

.notification-list-item:hover {
  border-color: var(--color-blood, #8B0000);
}

.notification-list-item.unread {
  background: linear-gradient(135deg, rgba(139, 0, 0, 0.1), transparent);
  border-left: 3px solid var(--color-blood, #8B0000);
}

.notification-list-item .notification-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary, #1a1a1a);
  border-radius: 50%;
  flex-shrink: 0;
}

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

.notification-list-item .notification-title {
  font-size: 1rem;
  margin-bottom: 5px;
  white-space: normal;
}

.notification-list-item .notification-message {
  display: block;
  -webkit-line-clamp: unset;
  margin-bottom: 8px;
}

.notification-meta {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
}

.notification-type {
  color: var(--color-gold, #D4AF37);
  background: rgba(212, 175, 55, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.notification-date {
  color: var(--text-muted, #666);
}

.notification-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.notification-actions .btn {
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */

.notification-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 6px;
  color: white;
  font-size: 0.95rem;
  z-index: 10000;
  animation: toastSlideIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.notification-toast-success {
  background: linear-gradient(135deg, #4CAF50, #45a049);
}

.notification-toast-error {
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

.notification-toast-info {
  background: linear-gradient(135deg, #2196F3, #1976D2);
}

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

@keyframes toastFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 480px) {
  .notification-dropdown {
    width: 100vw;
    right: -10px;
    border-radius: 0 0 var(--radius-lg, 8px) var(--radius-lg, 8px);
  }

  .notification-item {
    padding: 10px 12px;
  }

  .notification-icon {
    width: 30px;
    font-size: 1.2rem;
  }

  .notification-list-item {
    flex-direction: column;
    gap: 10px;
  }

  .notification-list-item .notification-icon {
    width: 40px;
    height: 40px;
  }

  .notification-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

/* ===================================================================
   PROFILE TAB NOTIFICATIONS
   =================================================================== */

#tab-notifications {
  padding: 0;
}

#tab-notifications .profile-card {
  margin-bottom: 20px;
}

#tab-notifications .profile-card:last-child {
  margin-bottom: 0;
}
