/* Dashboard Styles */
.header {
  text-align: center;
  margin-bottom: 30px;
}

.status-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.data-list {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  width: 100%;
  max-width: none;
}

.data-item {
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  background: #f8f9fa;
}

.data-item:last-child {
  margin-bottom: 0;
}

.data-item.new {
  border-left: 4px solid #28a745;
  background: #d4edda;
}

.controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #1e7e34;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background: #e0a800;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-online {
  background: #28a745;
  animation: pulse 2s infinite;
}

.status-offline {
  background: #dc3545;
}

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

.error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #f5c6cb;
  margin-bottom: 20px;
}

.json-display {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 200px;
  overflow-y: auto;
}

/* Table Styles for Data Viewer */
.data-table-container {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  min-width: 100%;
  table-layout: auto;
}

.data-table thead {
  background-color: #f8f9fa;
}

.data-table th {
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: top;
  font-size: 13px;
  color: #212529;
  background-color: white;
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Status badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

.status-success {
  background-color: #d4edda;
  color: #155724;
}

.status-pending {
  background-color: #fff3cd;
  color: #856404;
}

.status-failed {
  background-color: #f8d7da;
  color: #721c24;
}

/* Webhook ID styling */
.webhook-id {
  background-color: #e3f2fd;
  color: #1976d2;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
  display: inline-block;
}

/* Monospace fields */
.monospace {
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #495057;
  font-size: 18px;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: #6c757d;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #e9ecef;
  color: #495057;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.info-row {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
}

.info-row:last-child {
  margin-bottom: 0;
}

.info-label {
  font-weight: 600;
  color: #495057;
  min-width: 100px;
  margin-right: 12px;
}

.info-value {
  color: #6c757d;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.modal-data-section h4 {
  margin: 0 0 12px 0;
  color: #495057;
  font-size: 16px;
  font-weight: 600;
}

.modal-data-table-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.modal-data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.modal-data-table thead {
  background: #e9ecef;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-data-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  border-bottom: 2px solid #dee2e6;
}

.modal-data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
}

.modal-data-table tbody tr:hover {
  background-color: #f8f9fa;
}

.modal-data-table tbody tr:last-child td {
  border-bottom: none;
}

.field-name {
  font-weight: 600;
  color: #495057;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  min-width: 150px;
  max-width: 200px;
  word-break: break-word;
}

.field-value {
  color: #6c757d;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  word-break: break-word;
  max-width: 300px;
  white-space: pre-wrap;
  line-height: 1.4;
}

/* Special styling for different data types */
.field-value.number {
  color: #28a745;
  font-weight: 600;
}

.field-value.boolean {
  color: #007bff;
  font-weight: 600;
}

.field-value.string {
  color: #6c757d;
}

.field-value.object {
  color: #6f42c1;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.no-data {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.modal-json-display {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  color: #495057;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

/* Modal Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95vw;
    max-height: 95vh;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }
  
  .info-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .info-label {
    min-width: auto;
    margin-right: 0;
    margin-bottom: 4px;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
  
  .modal-data-table th,
  .modal-data-table td {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .field-name {
    min-width: 120px;
    max-width: 150px;
  }
  
  .field-value {
    max-width: 200px;
  }
  
  .modal-data-table-container {
    max-height: 300px;
  }
}

@media (max-width: 480px) {
  .modal-data-table th,
  .modal-data-table td {
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .field-name {
    min-width: 100px;
    max-width: 120px;
  }
  
  .field-value {
    max-width: 150px;
  }
}

/* Responsive table adjustments */
@media (max-width: 768px) {
  .data-table-container {
    font-size: 12px;
    width: 100%;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px;
  }
  
  .data-table {
    min-width: 100%;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .data-table-container {
    font-size: 11px;
    width: 100%;
  }
  
  .data-table th,
  .data-table td {
    padding: 6px;
  }
  
  .data-table {
    min-width: 100%;
    width: 100%;
  }
}