/* Activity Panel Styles */

.activity-panel {
  position: fixed;
  top: 60px;
  right: 12px;
  width: 280px;
  max-height: calc(100vh - 80px);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.activity-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.activity-panel-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #212529;
}

.activity-panel-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.activity-panel-close:hover {
  background: #e9ecef;
  color: #212529;
}

.activity-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.activity-loading {
  text-align: center;
  padding: 24px;
  color: #6c757d;
  font-size: 0.875rem;
}

.activity-empty {
  text-align: center;
  padding: 32px 16px;
  color: #6c757d;
}

.activity-empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.5;
  font-family: monospace;
}

.activity-empty p {
  margin: 0;
  font-size: 0.875rem;
}

.activity-empty-hint {
  margin-top: 4px !important;
  font-size: 0.75rem !important;
  opacity: 0.7;
}

.activity-list {
  padding: 0;
}

.activity-group {
  margin-bottom: 8px;
}

.activity-group-header {
  font-size: 0.7rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px 4px;
  background: #f8f9fa;
  position: sticky;
  top: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 8px 16px;
  gap: 10px;
  transition: background 0.15s ease;
}

.activity-item:hover {
  background: #f8f9fa;
}

.activity-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: monospace;
  flex-shrink: 0;
}

.activity-action-created {
  background: #d4edda;
  color: #155724;
}

.activity-action-deleted {
  background: #f8d7da;
  color: #721c24;
}

.activity-action-updated {
  background: #d1ecf1;
  color: #0c5460;
}

.activity-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-text {
  font-size: 0.8rem;
  color: #212529;
  line-height: 1.3;
}

.activity-user {
  font-weight: 600;
}

.activity-shape {
  color: #6c757d;
}

.activity-time {
  font-size: 0.7rem;
  color: #adb5bd;
}

/* Toggle Button */
.activity-toggle-btn {
  background: var(--tool-bg, #f8f9fa);
  border: 1px solid var(--tool-border, #dee2e6);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: #495057;
}

.activity-toggle-btn:hover {
  background: #e9ecef;
}

.activity-toggle-btn.active {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.activity-toggle-icon {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
}

/* Dark Mode */
html.dark .activity-panel {
  background: #2d2d2d;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html.dark .activity-panel-header {
  background: #3a3a3a;
  border-bottom-color: #495057;
}

html.dark .activity-panel-header h3 {
  color: #e9ecef;
}

html.dark .activity-panel-close {
  color: #adb5bd;
}

html.dark .activity-panel-close:hover {
  background: #495057;
  color: #e9ecef;
}

html.dark .activity-group-header {
  background: #3a3a3a;
  color: #adb5bd;
}

html.dark .activity-item:hover {
  background: #3a3a3a;
}

html.dark .activity-text {
  color: #e9ecef;
}

html.dark .activity-shape {
  color: #adb5bd;
}

html.dark .activity-time {
  color: #6c757d;
}

html.dark .activity-empty {
  color: #adb5bd;
}

html.dark .activity-action-created {
  background: #1e4d2b;
  color: #d4edda;
}

html.dark .activity-action-deleted {
  background: #4a1e1e;
  color: #f8d7da;
}

html.dark .activity-action-updated {
  background: #1e4a4a;
  color: #d1ecf1;
}

html.dark .activity-toggle-btn {
  background: #3a3a3a;
  border-color: #495057;
  color: #e9ecef;
}

html.dark .activity-toggle-btn:hover {
  background: #495057;
}

html.dark .activity-toggle-btn.active {
  background: #0d6efd;
  border-color: #0d6efd;
}

/* Responsive */
@media (max-width: 768px) {
  .activity-panel {
    width: calc(100vw - 24px);
    right: 12px;
    left: 12px;
    max-height: 50vh;
  }
}
