/* ============================================
   NOTIFICATION CENTER PANEL - PHASE 2
   Dropdown panel with detailed notification items
   ============================================ */

/* Panel Container */
.notification-panel {
  position: fixed;
  top: 73px;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: calc(100vh - 73px);
  background: var(--surface);
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: 250;
  display: flex;
  flex-direction: column;
}

.notification-panel.active {
  transform: translateX(0);
}

/* Panel Header */
.notification-panel-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.notification-panel-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.notification-panel-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.notification-mark-all-btn {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notification-mark-all-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

.notification-panel-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

.notification-panel-close:hover {
  background: var(--background);
}

/* Panel Body */
.notification-panel-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Loading State */
.notification-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  gap: var(--spacing-md);
  color: var(--text-secondary);
}

.notification-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Empty State */
.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl) var(--spacing-md);
  text-align: center;
  color: var(--text-secondary);
  min-height: 300px;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: var(--spacing-md);
  opacity: 0.3;
}

.notification-empty p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

/* Notification Section */
.notification-section {
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-md) 0;
}

.notification-section:last-child {
  border-bottom: none;
}

.notification-section-header {
  padding: var(--spacing-sm) var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
}

.notification-section-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.notification-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

/* Notification Items */
.notification-items {
  display: flex;
  flex-direction: column;
}

/* Notification Item Wrapper - Phase 3 Read/Unread */
.notification-item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  transition: all var(--transition-fast);
}

.notification-item-wrapper.read {
  opacity: 0.6;
}

.notification-item-wrapper.unread {
  opacity: 1;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 12px var(--spacing-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  cursor: pointer;
  border-left: 3px solid transparent;
  flex: 1;
  position: relative;
}

.notification-item:hover {
  background: var(--background);
  border-left-color: var(--primary-color);
}

.notification-item.read {
  opacity: 1;
}

.notification-item.unread {
  font-weight: 500;
}

/* Unread Dot Indicator - Phase 3 */
.notification-unread-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

/* Read Checkmark - Phase 3 */
.notification-read-check {
  color: var(--success-color, #4CAF50);
  font-size: 12px;
  font-weight: bold;
  opacity: 0.7;
}

/* Mark as Read Button - Phase 3 */
.notification-mark-read-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-light);
  color: var(--primary-dark);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 10;
}

.notification-item-wrapper:hover .notification-mark-read-btn {
  opacity: 1;
}

.notification-mark-read-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.notification-item-time {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* View All Link */
.notification-view-all {
  display: block;
  padding: 10px var(--spacing-lg);
  text-align: center;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background-color var(--transition-fast);
}

.notification-view-all:hover {
  background: var(--background);
}

/* Panel Overlay */
.notification-panel-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 200;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.notification-panel-overlay.active {
  display: block;
  opacity: 1;
}

/* Scrollbar Styling */
.notification-panel-body::-webkit-scrollbar {
  width: 6px;
}

.notification-panel-body::-webkit-scrollbar-track {
  background: transparent;
}

.notification-panel-body::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 3px;
}

.notification-panel-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .notification-panel {
    width: 100vw;
    right: 0;
  }
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Panel Slide-in Animation */
@keyframes panelSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Notification Item Appear Animation */
.notification-item {
  animation: itemFadeIn 0.3s ease-out;
}

@keyframes itemFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Badge Colors per Type */
.notification-section:nth-child(1) .notification-section-count {
  background: #FFF3E0;
  color: #E65100;
}

.notification-section:nth-child(2) .notification-section-count {
  background: #FFEBEE;
  color: #C62828;
}

.notification-section:nth-child(3) .notification-section-count {
  background: #E3F2FD;
  color: #1565C0;
}

.notification-section:nth-child(4) .notification-section-count {
  background: #E8F5E9;
  color: #2E7D32;
}

.notification-section:nth-child(5) .notification-section-count {
  background: #FFF3E0;
  color: #EF6C00;
}
