/**
 * 🕵️ Audit-Log-Viewer Styles
 * 
 * Moderne, übersichtliche Darstellung der Änderungsverfolgung
 */

/* ========================================
   AUDIT-LOG CONTAINER
   ======================================== */

.audit-log-container {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.audit-log-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--accent-color);
}

.audit-log-header h2 {
  margin: 0 0 5px 0;
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.audit-log-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ========================================
   FILTER-BEREICH
   ======================================== */

.audit-filters {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
  flex: 1;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.audit-filter-select,
.audit-filter-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.audit-filter-select:focus,
.audit-filter-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.1);
}

.audit-filter-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--accent-color);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-right: 10px;
}

.audit-filter-btn:hover {
  background: var(--accent-hover);
}

.audit-filter-btn.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.audit-filter-btn.secondary:hover {
  background: var(--border-light);
}

/* ========================================
   STATISTIKEN
   ======================================== */

.audit-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ========================================
   TABELLE
   ======================================== */

.audit-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  font-size: 0.9rem;
}

.audit-table th {
  background: var(--bg-secondary);
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.audit-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.audit-table tbody tr:hover {
  background: var(--bg-hover);
}

/* ========================================
   ZEILEN-STYLES
   ======================================== */

.audit-row.audit-create {
  border-left: 4px solid #28a745;
}

.audit-row.audit-update {
  border-left: 4px solid #ffc107;
}

.audit-row.audit-delete {
  border-left: 4px solid #dc3545;
}

.audit-row.audit-restore {
  border-left: 4px solid #17a2b8;
}

.audit-timestamp {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.audit-table-name {
  font-weight: 500;
  color: var(--accent-color);
}

.audit-record-id {
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

.audit-action {
  text-align: center;
}

.audit-action-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audit-action-create {
  background: #d4edda;
  color: #155724;
}

.audit-action-update {
  background: #fff3cd;
  color: #856404;
}

.audit-action-delete {
  background: #f8d7da;
  color: #721c24;
}

.audit-action-restore {
  background: #d1ecf1;
  color: #0c5460;
}

.audit-user {
  font-weight: 500;
  color: var(--text-primary);
}

.audit-details-btn {
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.audit-details-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.audit-restore-btn {
  padding: 4px 8px;
  border: 1px solid #17a2b8;
  border-radius: 4px;
  background: #17a2b8;
  color: white;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background-color 0.2s ease;
}

.audit-restore-btn:hover {
  background: #138496;
}

/* ========================================
   PAGINATION
   ======================================== */

.audit-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.audit-pagination-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.audit-pagination-btn:hover:not(:disabled) {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.audit-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.audit-page-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ========================================
   EXPORT-BEREICH
   ======================================== */

.audit-export {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.audit-export-btn {
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.audit-export-btn:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .audit-log-container {
    padding: 15px;
    margin: 15px 0;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 10px;
  }
  
  .filter-group {
    min-width: auto;
  }
  
  .audit-stats {
    flex-direction: column;
    gap: 10px;
  }
  
  .audit-table {
    font-size: 0.8rem;
  }
  
  .audit-table th,
  .audit-table td {
    padding: 8px 4px;
  }
  
  .audit-pagination {
    flex-direction: column;
    gap: 10px;
  }
  
  .audit-export {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .audit-log-header h2 {
    font-size: 1.3rem;
  }
  
  .audit-table-container {
    font-size: 0.75rem;
  }
  
  .audit-action-badge {
    font-size: 0.7rem;
    padding: 3px 6px;
  }
}

/* ========================================
   DARK MODE ANPASSUNGEN
   ======================================== */

[data-theme="dark"] .audit-log-container {
  background: var(--bg-secondary-dark);
  border-color: var(--border-color-dark);
}

[data-theme="dark"] .audit-filters,
[data-theme="dark"] .audit-stats {
  background: var(--bg-primary-dark);
  border-color: var(--border-color-dark);
}

[data-theme="dark"] .audit-table {
  background: var(--bg-primary-dark);
}

[data-theme="dark"] .audit-table th {
  background: var(--bg-secondary-dark);
  border-bottom-color: var(--border-color-dark);
}

[data-theme="dark"] .audit-table td {
  border-bottom-color: var(--border-light-dark);
}

[data-theme="dark"] .audit-table tbody tr:hover {
  background: var(--bg-hover-dark);
}

/* ========================================
   ANIMATIONEN
   ======================================== */

.audit-row {
  transition: background-color 0.2s ease;
}

.audit-action-badge {
  transition: all 0.2s ease;
}

.audit-details-btn,
.audit-restore-btn {
  transition: all 0.2s ease;
}

/* ========================================
   LOADING STATES
   ======================================== */

.audit-table-container.loading {
  opacity: 0.6;
  pointer-events: none;
}

.audit-table-container.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--accent-color);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
} 