/* AccessFlow - Custom Styles */
:root {
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #06b6d4 100%);
  --accent-gradient: linear-gradient(135deg, #22c55e 0%, #06b6d4 100%);
  --dark-gradient: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  --glass-bg: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(148, 163, 184, 0.1);
}

* { box-sizing: border-box; }

body {
  background: var(--dark-gradient);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated background */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 600px 600px at 20% 20%, rgba(59, 130, 246, 0.08), transparent),
    radial-gradient(ellipse 500px 500px at 80% 80%, rgba(139, 92, 246, 0.06), transparent),
    radial-gradient(ellipse 400px 400px at 50% 50%, rgba(6, 182, 212, 0.04), transparent);
}

/* Glass card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Upload zone */
.upload-zone {
  border: 2px dashed rgba(148, 163, 184, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.05);
}

.upload-zone.drag-over::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(59, 130, 246, 0.1);
  animation: pulse-bg 1s ease-in-out infinite;
}

@keyframes pulse-bg {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Progress bar */
.progress-track {
  background: rgba(30, 41, 59, 0.8);
  border-radius: 100px;
  overflow: hidden;
  height: 8px;
}

.progress-fill {
  background: var(--brand-gradient);
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Brand button */
.btn-brand {
  background: var(--brand-gradient);
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-brand:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-brand:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-brand:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #94a3b8;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

/* Step indicator */
.step-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.step-item.active {
  background: rgba(59, 130, 246, 0.1);
}

.step-item.completed {
  background: rgba(34, 197, 94, 0.08);
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.step-dot.pending {
  background: rgba(51, 65, 85, 0.8);
  color: #64748b;
  border: 2px solid rgba(100, 116, 139, 0.3);
}

.step-dot.active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 2px solid #3b82f6;
  animation: pulse-ring 2s ease-in-out infinite;
}

.step-dot.completed {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 2px solid #22c55e;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
}

/* Log viewer */
.log-viewer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(30, 41, 59, 0.8);
}

.log-viewer::-webkit-scrollbar {
  width: 6px;
}

.log-viewer::-webkit-scrollbar-track {
  background: transparent;
}

.log-viewer::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 3px;
}

.log-entry {
  display: flex;
  gap: 0.5rem;
  padding: 2px 0;
}

.log-time {
  color: #475569;
  flex-shrink: 0;
}

.log-info { color: #60a5fa; }
.log-success { color: #4ade80; }
.log-warn { color: #fbbf24; }
.log-error { color: #f87171; }
.log-dim { color: #64748b; }

/* Tag badge */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}

/* PDF Preview */
.pdf-preview-container {
  background: rgba(2, 6, 23, 0.6);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(30, 41, 59, 0.8);
}

.pdf-page-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  margin: 1rem;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pdf-page-preview canvas {
  max-width: 100%;
  height: auto;
}

/* Stats card */
.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(30, 41, 59, 0.6);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  background: rgba(15, 23, 42, 0.8);
}

/* Compliance badges */
.compliance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.compliance-badge.wcag {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.compliance-badge.pdfua {
  background: rgba(168, 85, 247, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.compliance-badge.s508 {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Tooltip */
.tooltip-container {
  position: relative;
}

.tooltip-container .tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 50;
  margin-bottom: 8px;
  opacity: 0;
  transition: all 0.2s ease;
}

.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Fade animations */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

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

.slide-up {
  animation: slideUp 0.5s ease forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Input field */
.input-field {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 10px;
  padding: 0.625rem 1rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
}

.input-field:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field::placeholder {
  color: #475569;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .glass-card { padding: 1rem; }
  .btn-brand { padding: 0.625rem 1.25rem; }
}

/* Page transition */
.page-enter {
  animation: pageEnter 0.3s ease forwards;
}

@keyframes pageEnter {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: #0f172a;
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

/* Structure tree view */
.tree-node {
  padding-left: 1.25rem;
  border-left: 1px solid rgba(51, 65, 85, 0.4);
  margin-left: 0.5rem;
}

.tree-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: default;
  transition: background 0.15s ease;
}

.tree-label:hover {
  background: rgba(51, 65, 85, 0.3);
}
