/**
 * Nizu to n8n Connector - Plugin Styles
 * Version: 1.0.0
 */

/* ============================================
   Dashboard Widgets
   ============================================ */

.nizutonen-dashboard-widget {
  padding: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.nizutonen-dashboard-widget:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.nizutonen-widget-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.nizutonen-widget-value {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.nizutonen-widget-pending .nizutonen-widget-value {
  color: #ffc107;
}

.nizutonen-widget-success .nizutonen-widget-value {
  color: #28a745;
}

.nizutonen-widget-failed .nizutonen-widget-value {
  color: #dc3545;
}

.nizutonen-widget-dead .nizutonen-widget-value {
  color: #6c757d;
}

.nizutonen-widget-footer {
  font-size: 12px;
  color: #999;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

/* ============================================
   Quick Actions
   ============================================ */

.nizutonen-quick-actions {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.nizutonen-quick-actions .btn {
  margin-right: 10px;
  margin-bottom: 10px;
}

/* ============================================
   Webhook List Styling
   ============================================ */

.nizutonen-webhook-url {
  font-family: "Monaco", "Courier New", monospace;
  font-size: 12px;
  color: #495057;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nizutonen-event-count {
  display: inline-block;
  padding: 4px 8px;
  background: #e9ecef;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #495057;
}

.nizutonen-webhook-active {
  color: #28a745;
}

.nizutonen-webhook-inactive {
  color: #dc3545;
}

/* ============================================
   Event Selector
   ============================================ */

.nizutonen-event-selector {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  background: #f8f9fa;
}

.nizutonen-event-category {
  margin-bottom: 20px;
}

.nizutonen-category-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #007bff;
  display: inline-block;
}

.nizutonen-event-checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.nizutonen-event-checkbox {
  display: flex;
  align-items: center;
}

.nizutonen-event-checkbox input[type="checkbox"] {
  margin-right: 8px;
}

.nizutonen-event-checkbox label {
  margin-bottom: 0;
  font-size: 13px;
  cursor: pointer;
}

.nizutonen-select-all-controls {
  margin-bottom: 20px;
  padding: 15px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.nizutonen-select-all-controls .btn {
  margin-right: 10px;
}

/* ============================================
   Custom Headers Section
   ============================================ */

.nizutonen-custom-headers-container {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  background: #f8f9fa;
}

.nizutonen-header-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: flex-start;
}

.nizutonen-header-key {
  flex: 1;
}

.nizutonen-header-value {
  flex: 2;
}

.nizutonen-header-remove {
  flex-shrink: 0;
}

.nizutonen-add-header-btn {
  margin-top: 10px;
}

/* ============================================
   Secret Key Display
   ============================================ */

.nizutonen-secret-display {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nizutonen-secret-input {
  flex: 1;
  font-family: "Monaco", "Courier New", monospace;
  font-size: 12px;
  background: #f8f9fa;
}

.nizutonen-copy-btn,
.nizutonen-rotate-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================
   Queue Status Cards
   ============================================ */

.nizutonen-queue-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.nizutonen-queue-stat-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
}

.nizutonen-queue-stat-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nizutonen-queue-stat-label {
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}

.nizutonen-queue-stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #333;
}

.nizutonen-queue-stat-card.pending .nizutonen-queue-stat-value {
  color: #ffc107;
}

.nizutonen-queue-stat-card.processing .nizutonen-queue-stat-value {
  color: #17a2b8;
}

.nizutonen-queue-stat-card.success .nizutonen-queue-stat-value {
  color: #28a745;
}

.nizutonen-queue-stat-card.failed .nizutonen-queue-stat-value {
  color: #dc3545;
}

.nizutonen-queue-stat-card.dead_letter .nizutonen-queue-stat-value {
  color: #6c757d;
}

/* ============================================
   Queue Health Table
   ============================================ */

.nizutonen-queue-health {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
}

.nizutonen-queue-health h4 {
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: 600;
}

.nizutonen-health-table {
  width: 100%;
}

.nizutonen-health-table th {
  font-size: 12px;
  text-transform: uppercase;
  color: #666;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
}

.nizutonen-health-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f1f1f1;
}

.nizutonen-health-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.nizutonen-health-status.healthy {
  background: #d4edda;
  color: #155724;
}

.nizutonen-health-status.warning {
  background: #fff3cd;
  color: #856404;
}

.nizutonen-health-status.critical {
  background: #f8d7da;
  color: #721c24;
}

/* ============================================
   Log Details Modal
   ============================================ */

.nizutonen-log-details-section {
  margin-bottom: 25px;
}

.nizutonen-log-details-section h5 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #007bff;
}

.nizutonen-detail-table {
  width: 100%;
  font-size: 13px;
}

.nizutonen-detail-table th {
  text-align: left;
  padding: 8px;
  background: #f8f9fa;
  font-weight: 600;
  color: #495057;
  width: 30%;
}

.nizutonen-detail-table td {
  padding: 8px;
  border-bottom: 1px solid #f1f1f1;
}

.nizutonen-code-block {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 4px;
  font-family: "Monaco", "Courier New", monospace;
  font-size: 12px;
  overflow-x: auto;
  max-height: 300px;
  border: 1px solid #dee2e6;
}

.nizutonen-error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
  font-size: 13px;
}

/* ============================================
   Status Badges
   ============================================ */

.nizutonen-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.nizutonen-status-badge.success {
  background: #d4edda;
  color: #155724;
}

.nizutonen-status-badge.failed {
  background: #f8d7da;
  color: #721c24;
}

.nizutonen-status-badge.pending {
  background: #fff3cd;
  color: #856404;
}

.nizutonen-status-badge.processing {
  background: #d1ecf1;
  color: #0c5460;
}

/* ============================================
   Settings Page
   ============================================ */

.nizutonen-settings-section {
  margin-bottom: 30px;
}

.nizutonen-settings-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
}

/* ============================================
   Settings Page Specific
   ============================================ */

.nizutonen-settings-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 15px 20px;
}

.nizutonen-settings-card .card-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .nizutonen-event-checkbox-group {
    grid-template-columns: 1fr;
  }

  .nizutonen-queue-stats {
    grid-template-columns: 1fr;
  }

  .nizutonen-header-row {
    flex-direction: column;
  }
}
