/* Notification History Modal Styles - FULL SCREEN */
/* Import Animal Tracker Design System */
:root {
  /* Animal Tracker Color Palette */
  --tracker-primary: #01161b;
  --tracker-secondary: #ffffff;
  --tracker-accent: #f0bc3c;
  --tracker-info: #0f9cb9;
  --tracker-text-normal: #616161;
  
  /* Notification States */
  --notif-unread-bg: rgba(15, 156, 185, 0.08);
  --notif-unread-border: #0f9cb9;
  --notif-read-bg: rgba(255, 255, 255, 0.95);
  --notif-read-opacity: 0.8;
  
  /* Consistent Shadows */
  --shadow-card: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.25s ease;
}

.notification-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 99999;
  animation: fadeIn 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

.notification-history-container {
  width: 100%;
  height: 100vh;
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  display: flex;
  flex-direction: column;
}

/* Header - Animal Tracker Style */
.notification-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 2px solid rgba(15, 156, 185, 0.1);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}

.notification-history-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--tracker-primary);
  letter-spacing: -0.5px;
}

.close-button {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 156, 185, 0.2);
  cursor: pointer;
  padding: 8px;
  border-radius: 15px;
  transition: all var(--transition-fast);
  color: var(--tracker-primary);
  box-shadow: var(--shadow-card);
}

.close-button:hover {
  background: var(--tracker-info);
  color: white;
  transform: scale(1.05);
  box-shadow: var(--shadow-card-hover);
}

/* Toolbar - Animal Tracker Style */
.notification-history-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(15, 156, 185, 0.1);
  flex-shrink: 0;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-buttons {
  display: flex;
  gap: 10px;
}

.filter-btn {
  padding: 8px 16px;
  background: var(--tracker-secondary);
  border: 1px solid rgba(15, 156, 185, 0.2);
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tracker-text-normal);
  transition: all var(--transition-fast);
  position: relative;
  box-shadow: var(--shadow-card);
  font-weight: 500;
}

.filter-btn:hover {
  background: rgba(15, 156, 185, 0.1);
  border-color: var(--tracker-info);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.filter-btn.active {
  background: var(--tracker-info);
  color: white;
  border-color: var(--tracker-info);
  box-shadow: 0 4px 8px rgba(15, 156, 185, 0.3);
}

.filter-btn .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--tracker-accent);
  color: var(--tracker-primary);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-container {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid rgba(15, 156, 185, 0.2);
  border-radius: 15px;
  font-size: 14px;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.9);
  color: var(--tracker-primary);
}

.search-input:focus {
  outline: none;
  border-color: var(--tracker-info);
  box-shadow: 0 0 0 3px rgba(15, 156, 185, 0.1);
  background: white;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  pointer-events: none;
}

/* Main List Container - Inherits full screen from parent */
.notification-history-container.notification-list-only {
  /* Container is already full screen from parent styles */
}

/* Notification List Body */
.notification-list-body {
  flex: 1;
  overflow-y: auto;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), rgba(248, 250, 252, 0.8));
  padding: 30px 20px;
  min-height: 0; /* Important for flex overflow */
}

.notification-list {
  max-width: 1000px;
  margin: 0 auto;
}

/* Groups removed - no longer using them */

/* Notification Card - Enhanced Read/Unread States */
.notification-card {
  background: var(--notif-read-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 15px;
  padding: 16px 16px 48px 16px;
  margin-bottom: 12px;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  opacity: var(--notif-read-opacity);
  box-shadow: var(--shadow-card);
  min-height: 100px;
}

.notification-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  opacity: 1;
  background: rgba(255, 255, 255, 1);
}

.notification-card.unread:hover {
  background: rgba(15, 156, 185, 0.12);
}

/* Unread State with Multiple Visual Cues */
.notification-card.unread {
  background: var(--notif-unread-bg);
  border-color: rgba(15, 156, 185, 0.2);
  border-left: 4px solid var(--notif-unread-border);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(15, 156, 185, 0.15);
}

.notification-card.unread::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 24px;
  width: 8px;
  height: 8px;
  background: var(--tracker-info);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(15, 156, 185, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 156, 185, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(15, 156, 185, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(15, 156, 185, 0);
  }
}

.notification-card.unread .notification-card-content {
  padding-left: 16px;
}

.notification-card.expired {
  opacity: 0.5;
  background: rgba(200, 200, 200, 0.1);
}

.notification-card-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.notification-card-header {
  margin-bottom: 8px;
}

.notification-datetime {
  font-size: 13px;
  color: var(--tracker-text-normal);
  opacity: 0.8;
}

.notification-card.unread .notification-datetime {
  color: var(--tracker-info);
  font-weight: 500;
  opacity: 1;
}

.notification-preview {
  font-size: 14px;
  color: var(--tracker-primary);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  opacity: 0.9;
}

.notification-card.unread .notification-preview {
  font-weight: 500;
  opacity: 1;
}

/* Meta and view count removed - no longer showing them */

/* Show Details Button - Animal Tracker Style */
.notification-show-button {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 156, 185, 0.15);
  color: var(--tracker-info);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: absolute;
  right: 50%;
  bottom: 5%;
  transform: translateX(50%);
}

.notification-show-button:hover {
  background: var(--tracker-info);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(15, 156, 185, 0.3);
}

.notification-show-button:active {
  transform: scale(0.95);
}

.notification-card.unread .notification-show-button {
  background: var(--tracker-info);
  color: white;
  border-color: var(--tracker-info);
}

.notification-show-button svg {
  width: 18px;
  height: 18px;
}

/* Detail Modal - Animal Tracker Style */
.notification-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(1, 22, 27, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.3s ease;
}

.notification-detail-container {
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  border: 2px solid rgba(15, 156, 185, 0.2);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(15, 156, 185, 0.1);
  animation: slideUp 0.3s ease;
  overflow: hidden;
}

.notification-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-date {
  font-size: 14px;
  color: #6c757d;
}

.detail-badges {
  display: flex;
  gap: 8px;
}

.notification-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.notification-detail-footer {
  padding: 16px 24px;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.detail-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.detail-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--tracker-text-normal);
  padding: 40px;
  text-align: center;
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.3;
  color: var(--tracker-info);
}

.empty-state p {
  margin: 0;
  font-size: 16px;
  color: var(--tracker-text-normal);
  font-weight: 500;
}

.badge {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1.2;
}

.unread-badge {
  background: #007bff;
  color: white;
}

.expired-badge {
  background: #ffc107;
  color: #000;
}

.action-btn {
  padding: 8px 16px;
  background: var(--tracker-secondary);
  border: 1px solid rgba(15, 156, 185, 0.2);
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tracker-text-normal);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
  font-weight: 500;
}

.action-btn:hover {
  background: var(--tracker-info);
  color: white;
  border-color: var(--tracker-info);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.notification-image {
  margin-bottom: 20px;
  text-align: center;
}

.notification-image img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-message {
  font-size: 16px;
  line-height: 1.8;
  color: #212529;
}

/* Style links in notification messages */
.notification-message a {
  color: #007bff;
  text-decoration: underline;
}

.notification-message a:hover {
  color: #0056b3;
}

/* Center aligned content in messages */
.notification-message center {
  text-align: center;
  display: block;
  margin: 16px 0;
}

/* Style bold text */
.notification-message b {
  font-weight: 600;
}

/* Style italic text */
.notification-message i {
  font-style: italic;
}

/* Style underlined text */
.notification-message u {
  text-decoration: underline;
}

/* Ensure emojis display properly */
.notification-message img.emoji {
  display: inline;
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.2em;
  margin: 0 2px;
}


.info-item {
  font-size: 13px;
  color: #6c757d;
}

.info-item strong {
  color: #495057;
  margin-right: 4px;
}

/* Pagination - Animal Tracker Style */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid rgba(15, 156, 185, 0.1);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  margin-top: 20px;
}

.pagination-btn {
  padding: 8px 16px;
  background: var(--tracker-secondary);
  border: 1px solid rgba(15, 156, 185, 0.2);
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tracker-text-normal);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
  font-weight: 500;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--tracker-info);
  color: white;
  border-color: var(--tracker-info);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(200, 200, 200, 0.3);
}

.pagination-info {
  font-size: 14px;
  color: #6c757d;
}

/* Loading State */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(15, 156, 185, 0.1);
  border-top: 3px solid var(--tracker-info);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* Smooth transitions for status changes */
.notification-card {
  animation: statusChange 0.5s ease when status changes;
}

@keyframes statusChange {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Toolbar Button */
.notification-toolbar-button {
  position: relative;
  width: 40px;
  height: 40px;
  background: rgba(48, 51, 54, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.notification-toolbar-button:hover {
  background: rgba(48, 51, 54, 0.95);
  transform: scale(1.05);
}

.notification-toolbar-button svg {
  width: 20px;
  height: 20px;
  color: white;
}

.notification-toolbar-button .notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc3545;
  color: white;
  border-radius: 10px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: bold;
  min-width: 16px;
  text-align: center;
  border: 2px solid rgba(48, 51, 54, 0.8);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal Transitions */
.modal-fade-enter-active,
.modal-fade-leave-active {
  transition: opacity 0.3s;
}

.modal-fade-enter-from,
.modal-fade-leave-to {
  opacity: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  /* History container is already full screen */
  
  .notification-history-header {
    padding: 16px 20px;
  }
  
  .notification-history-header h2 {
    font-size: 20px;
  }
  
  .notification-history-toolbar {
    padding: 16px 20px;
  }
  
  .notification-detail-container {
    width: 95%;
    max-width: none;
    margin: 20px auto;
  }
  
  .notification-history-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-container {
    max-width: 100%;
  }
  
  .filter-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .notification-card {
    padding: 12px 12px 20px 12px;
    min-height: 90px;
  }
  
  .notification-datetime {
    font-size: 12px;
  }
  
  .notification-show-button {
    width: 28px;
    height: 28px;
    bottom: 8px;
  }
  
  .notification-show-button svg {
    width: 16px;
    height: 16px;
  }
  
  .detail-info {
    flex-direction: column;
    gap: 8px;
  }
  
  .notification-detail-footer {
    flex-direction: column;
    gap: 12px;
  }
}