/**
 * notifications.css
 * Styling for the notification center page
 */

/* ----- NOTIFICATION CONTROLS ----- */
.notification-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.filter-button {
  background-color: var(--bg-color);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 5px 10px;
  font-family: var(--terminal-font);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  min-width: 48px;
  min-height: 48px;
}

.filter-button:hover {
  background-color: rgba(var(--primary-color-rgb), 0.2);
  box-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.3);
}

.filter-button.active {
  background-color: var(--primary-color);
  color: var(--bg-color);
  box-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.5);
}

/* ----- ACTION BUTTONS ----- */
.notification-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  text-transform: uppercase;
}

.action-button {
  background-color: var(--bg-color);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 6px 12px;
  font-family: var(--terminal-font);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  text-transform: uppercase;
}

.action-button:hover {
  background-color: rgba(var(--primary-color-rgb), 0.2);
  box-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.3);
}

.action-button.danger {
  border-color: #ff5555;
  color: #ff5555;
}

.action-button.danger:hover {
  background-color: rgba(255, 85, 85, 0.2);
  box-shadow: 0 0 8px rgba(255, 85, 85, 0.3);
}

/* ----- CARD HEADER WITH BADGE ----- */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unread-badge {
  background-color: var(--primary-color);
  color: var(--bg-color);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  min-width: 25px;
  text-align: center;
}

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

/* ----- NOTIFICATIONS CONTAINER ----- */
#notifications-container {
  min-height: 200px;
  position: relative;
}

.loading-message {
  text-align: center;
  padding: 20px;
  color: #888;
}

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

.empty-state i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* ----- NOTIFICATION ITEMS ----- */
.notification-item {
  display: flex;
  padding: 12px;
  border-bottom: 1px solid rgba(var(--primary-color-rgb), 0.2);
  transition: background-color 0.2s ease;
  position: relative;
  background-color: rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.3s ease-out;
}

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

.notification-item[data-read="true"] {
  opacity: 0.6;
}

/* Level-specific styling */
.notification-item[data-level="success"] {
  border-left: 3px solid #32cd32;
}

.notification-item[data-level="info"] {
  border-left: 3px solid #00dfff;
}

.notification-item[data-level="warning"] {
  border-left: 3px solid #ffd700;
}

.notification-item[data-level="error"] {
  border-left: 3px solid #ff5555;
}

/* ----- NOTIFICATION COMPONENTS ----- */
.notification-icon {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.notification-content {
  flex: 1;
  padding: 0 15px;
}

.notification-message {
  margin-bottom: 5px;
  word-break: break-word;
  color: white;
}

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

.full-timestamp {
  font-size: 0.8em;
  color: #888;
}

.notification-category {
  text-transform: uppercase;
  font-size: 0.7rem;
  color: #aaa;
}

/* Level-specific icon colors */
.notification-item[data-level="success"] .notification-icon i {
  color: #32cd32;
}

.notification-item[data-level="info"] .notification-icon i {
  color: #00dfff;
}

.notification-item[data-level="warning"] .notification-icon i {
  color: #ffd700;
}

.notification-item[data-level="error"] .notification-icon i {
  color: #ff5555;
}

/* ----- NOTIFICATION ITEM ACTIONS ----- */
.notification-actions {
  flex: 0 0 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.notification-actions button {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mark-read-button:hover {
  color: #32cd32;
  background-color: rgba(50, 205, 50, 0.1);
}

.delete-button:hover {
  color: #ff5555;
  background-color: rgba(255, 85, 85, 0.1);
}

/* Hide delete button for block notifications */
.notification-item[data-category="block"] .delete-button {
  display: none;
}

/* ----- PAGINATION ----- */
.pagination-controls {
  margin-top: 15px;
  text-align: center;
}

.load-more-button {
  background-color: var(--bg-color);
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 5px 15px;
  font-family: var(--terminal-font);
  cursor: pointer;
  transition: all 0.3s ease;
}

.load-more-button:hover {
  background-color: rgba(var(--primary-color-rgb), 0.2);
  box-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.3);
}

.load-more-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ----- ANIMATIONS ----- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- RESPONSIVE STYLES ----- */
@media (max-width: 768px) {
  .notification-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-bottom: 5px;
    margin-bottom: 10px;
    width: 100%;
  }

  .filter-button {
    text-align: center;
    white-space: normal;
    font-size: 0.9rem;
    padding: 8px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
  }

  .notification-actions {
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    justify-content: stretch;
  }

  .action-button {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.95rem;
  }

  /* Notification item adjustments */
  .notification-item {
    padding: 8px;
  }

  .notification-icon {
    flex: 0 0 30px;
  }

  .notification-content {
    padding: 0 8px;
  }

  .notification-actions {
    flex: 0 0 60px;
  }
}

/* Very small screens */
@media (max-width: 375px) {
  .filter-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Landscape orientation adjustments for short screens */
@media (orientation: landscape) and (max-height: 500px) {
  .notification-controls {
    flex-direction: row;
  }
  .filter-buttons {
    grid-template-columns: repeat(4, 1fr);
  }
}
