/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Admin Page Layout & Aesthetics */
body.admin-body {
  background-color: #f3f4f6;
  color: #1f2937;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
}

.admin-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  background-color: #ffffff;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-admin {
  background-color: #e0f2fe;
  color: #0369a1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-email {
  font-weight: 500;
  color: #4b5563;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

.btn-danger {
  background-color: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

/* Card & Table */
.logs-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.logs-table th {
  background-color: #f9fafb;
  padding: 14px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #4b5563;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
}

.logs-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
  vertical-align: middle;
}

.log-row {
  transition: background-color 0.15s ease;
}

.log-row:hover {
  background-color: #f9fafb;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.text-small {
  font-size: 0.825rem;
}

.text-muted {
  color: #9ca3af;
}

/* Status Badges */
.badge-status {
  padding: 4px 8px;
  font-size: 0.7rem;
}

.badge-success {
  background-color: #ecfdf5;
  color: #047857;
}

.badge-failed {
  background-color: #fef2f2;
  color: #b91c1c;
}

.badge-in_progress {
  background-color: #eff6ff;
  color: #1d4ed8;
}

.badge-stalled {
  background-color: #fffbef;
  color: #b45309;
}

.badge-unknown {
  background-color: #f3f4f6;
  color: #4b5563;
}

/* Interactive Links */
.error-link {
  color: #b91c1c;
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 600;
  border-bottom: 1px dashed #b91c1c;
  transition: opacity 0.2s;
}

.error-link:hover {
  opacity: 0.8;
}

.checkpoints-link {
  color: #1d4ed8;
  text-decoration: none;
  font-size: 0.825rem;
  font-weight: 600;
  border-bottom: 1px dashed #1d4ed8;
  transition: opacity 0.2s;
}

.checkpoints-link:hover {
  opacity: 0.8;
}

/* Details Drawers / Panes */
.details-row {
  background-color: #f9fafb;
}

.details-pane {
  margin: 10px 24px 20px 24px;
  padding: 20px;
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
  border-left: 4px solid #9ca3af;
  background-color: #ffffff;
}

.error-pane {
  border-left-color: #ef4444;
  background-color: #fffafb;
}

.checkpoints-pane {
  border-left-color: #3b82f6;
  background-color: #f8fafc;
}

.pane-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
}

.pane-body {
  font-size: 0.875rem;
  color: #4b5563;
}

.error-message {
  color: #b91c1c;
  font-weight: 500;
}

.backtrace-box {
  background-color: #1e293b;
  color: #f1f5f9;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  max-height: 250px;
  margin-top: 8px;
}

/* Checkpoint Timeline */
.checkpoint-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 20px;
  border-left: 2px solid #e5e7eb;
  margin: 10px 0;
}

.timeline-node {
  position: relative;
}

.node-marker {
  position: absolute;
  left: -29px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #3b82f6;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.node-content {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.node-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.node-step code {
  background-color: #f3f4f6;
  color: #1f2937;
  padding: 2px 4px;
  border-radius: 4px;
}

.node-time {
  font-weight: 500;
}

.node-message {
  font-size: 0.85rem;
  color: #374151;
}

/* Fade-in Animation */
.fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Admin Dashboard Specific Styles */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.stat-card.danger::before {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.stat-card.warning::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.stat-card.info::before {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.stat-card.clickable.active {
  border-color: #3b82f6;
  background-color: #fafbfc;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card.clickable.danger.active {
  border-color: #ef4444;
  background-color: #fdfafb;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card.clickable.warning.active {
  border-color: #f59e0b;
  background-color: #fdfbf7;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card.clickable.info.active {
  border-color: #8b5cf6;
  background-color: #faf9fd;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-title {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  margin-top: 8px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.tool-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 30px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

.tool-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(255, 255, 255, 0.85);
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  margin-bottom: 20px;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.tool-card:hover .tool-icon {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  transform: scale(1.1);
}

.tool-card.logs-tool .tool-icon {
  color: #059669;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.tool-card.logs-tool:hover .tool-icon {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
}

.tool-card.jobs-tool .tool-icon {
  color: #7c3aed;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}

.tool-card.jobs-tool:hover .tool-icon {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #ffffff;
}

.tool-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px 0;
}

.tool-desc {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
  flex-grow: 1;
}

.tool-link-text {
  margin-top: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.tool-card.logs-tool .tool-link-text {
  color: #059669;
}

.tool-card.jobs-tool .tool-link-text {
  color: #7c3aed;
}


