
:root {
  --color-bg: #0b1220;
  --color-bg-gradient: linear-gradient(135deg, #0b1220 0%, #1a2332 50%, #0b1220 100%);
  --color-surface: #0f172a;
  --color-surface-2: #111827;
  --color-surface-3: #1e293b;
  --color-text: #e5e7eb;
  --color-text-bright: #f8fafc;
  --color-muted: #94a3b8;
  --color-muted-2: #64748b;
  --color-primary: #3b82f6;
  --color-primary-600: #2563eb;
  --color-primary-700: #1d4ed8;
  --color-primary-800: #1e40af;
  --color-secondary: #06b6d4;
  --color-secondary-600: #0891b2;
  --color-outline: #334155;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-border: #1f2937;
  --color-border-light: #374151;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-1: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-2: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-3: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
  --container-width: 1200px;
  --transition: 200ms cubic-bezier(.2,.6,.2,1);
  --transition-fast: 120ms cubic-bezier(.2,.6,.2,1);
  --transition-slow: 300ms cubic-bezier(.2,.6,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: 
    radial-gradient(1200px 800px at 20% -20%, rgba(59, 130, 246, 0.1), transparent),
    radial-gradient(800px 600px at 110% 20%, rgba(139, 92, 246, 0.1), transparent),
    radial-gradient(600px 400px at 50% 120%, rgba(6, 182, 212, 0.05), transparent),
    var(--color-bg-gradient);
  color: var(--color-text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Animated background particles */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 100px 100px, 80px 80px;
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -10px) rotate(1deg); }
  66% { transform: translate(-5px, 5px) rotate(-1deg); }
}

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 16px; }

.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: static; width: auto; height: auto; padding: 8px 12px; background: var(--color-primary); color: white; border-radius: 6px; }

.app-header {
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(20px) saturate(180%);
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(to bottom, rgba(11,18,32,0.95), rgba(11,18,32,0.85));
  box-shadow: 0 1px 0 0 rgba(59, 130, 246, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}
.app-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo { 
  font-size: 32px; 
  filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3));
  animation: logoGlow 3s ease-in-out infinite alternate;
}
@keyframes logoGlow {
  from { filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.3)); }
  to { filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.5)); }
}
.brand-title { 
  margin: 0; 
  font-size: 26px; 
  font-weight: 800; 
  letter-spacing: -0.02em; 
  background: linear-gradient(135deg, var(--color-text-bright), #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-subtitle { 
  margin: 0; 
  font-size: 14px; 
  color: var(--color-muted);
  font-weight: 500;
}
.header-actions { display: flex; gap: 12px; align-items: center; }

.anycoder-link {
  color: var(--color-text);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--color-outline);
  border-radius: 999px;
  transition: all var(--transition);
  font-size: 14px;
}
.anycoder-link:hover { border-color: var(--color-primary); color: white; background: #0f172a; }

main.container { padding: 24px 16px; }

.card {
  background: linear-gradient(135deg, rgba(17,24,39,0.9), rgba(15,23,42,0.8));
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 
    var(--shadow-1),
    0 0 0 1px rgba(59, 130, 246, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-slow);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 
    var(--shadow-2),
    var(--shadow-glow),
    0 0 0 1px rgba(59, 130, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

.section-header { margin-bottom: 20px; }
.section-header h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.01em; }
.section-header .muted { margin: 0; color: var(--color-muted); font-size: 14px; }

.form-row { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--color-outline);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: all var(--transition);
  font-size: 15px;
  font-weight: 500;
}
.form-input:focus { 
  border-color: var(--color-primary); 
  box-shadow: 
    0 0 0 3px rgba(59,130,246,0.15),
    0 4px 12px rgba(59, 130, 246, 0.1);
  background: var(--color-surface-3);
  transform: translateY(-1px);
}
.form-input::placeholder {
  color: var(--color-muted);
  font-weight: 400;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--color-surface);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--color-outline);
  position: relative;
}
.mode-toggle input[type="radio"] { display: none; }
.mode-option {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--color-muted);
  border: 1px solid transparent;
  transition: all var(--transition);
  user-select: none;
  font-weight: 600;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}
.mode-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s ease;
}
.mode-option:hover::before {
  left: 100%;
}
.mode-option:hover { 
  background: #0f172a; 
  color: var(--color-text); 
  transform: translateY(-1px);
}
.mode-toggle input[type="radio"]:checked + .mode-option {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: var(--color-primary);
  color: white;
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 4px 12px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.file-input-wrapper {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: 10px;
  padding: 8px 10px;
}
.file-input-wrapper input[type="file"] {
  position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none;
}
.file-name { color: var(--color-muted); font-size: 14px; }

.url-input-wrapper {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: 10px;
  padding: 8px 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.url-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
}
.url-input-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color-text);
  outline: none;
  padding: 0;
  font: inherit;
}
.url-input-wrapper input::placeholder {
  color: var(--color-muted);
}

.conditional.hidden { display: none; }

.form-actions { margin-top: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-700));
  color: white;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.btn:hover::before {
  left: 100%;
}
.btn:hover { 
  background: linear-gradient(135deg, var(--color-primary-600), var(--color-primary-800)); 
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(59, 130, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn:active { 
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
  background: #374151; color: #9ca3af;
  box-shadow: none;
}
.btn-secondary { background: #374151; color: white; }
.btn-secondary:hover { background: #4b5563; }
.btn-outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-text);
}
.btn-outline:hover {
  background: #0f172a;
  color: white;
}
.btn-light {
  background: #1f2937;
  border-color: var(--color-outline);
  color: var(--color-text);
}
.btn-light:hover {
  background: #273244;
}

.inline-actions { margin-top: 16px; }

.error-message {
  color: var(--color-danger);
  font-size: 13px;
  margin-top: 6px;
  min-height: 18px;
}

.progress-container {
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.progress-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), var(--color-primary));
  background-size: 200% 100%;
  animation: progressGlow 2s linear infinite;
}
@keyframes progressGlow {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.progress-header { 
  display: flex; justify-content: space-between; align-items: center; 
  margin-bottom: 16px; 
}
.status-label { 
  font-weight: 700; 
  font-size: 16px;
  color: var(--color-text-bright);
}
.progress-percent { 
  color: var(--color-muted); 
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 18px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.progress-bar {
  width: 100%; height: 16px;
  background: #0f172a;
  border: 1px solid var(--color-outline);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary), #22d3ee);
  background-size: 200% 100%;
  transition: width 500ms cubic-bezier(.4,.0,.2,1);
  animation: progressShine 2s linear infinite;
  position: relative;
  border-radius: 999px;
}
@keyframes progressShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressSweep 2s ease-in-out infinite;
}
@keyframes progressSweep {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
.progress-message {
  margin: 16px 0 0;
  color: var(--color-muted);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  padding: 8px 0;
}
.results-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.result-card {
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: 12px;
  padding: 16px;
}
.result-card h3 { margin: 0 0 6px; }

.gallery { display: grid; gap: 8px; }
.gallery-group-title {
  margin-top: 8px; margin-bottom: 8px;
  color: var(--color-muted);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.gallery-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-outline);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}
.gallery-item:hover::before {
  left: 100%;
}
.gallery-item:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-3);
  transform: translateY(-3px) translateX(2px);
  box-shadow: 
    0 8px 25px rgba(59, 130, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.gallery-item:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.gallery-item.selected {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}
.gallery-number {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); 
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 14px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}
.gallery-number::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
  animation: numberShine 3s ease-in-out infinite;
}
@keyframes numberShine {
  0%, 100% { transform: translateX(-100%) skewX(-25deg); }
  50% { transform: translateX(100%) skewX(-25deg); }
}
.gallery-content { min-width: 0; }
.gallery-title { 
  font-weight: 700; 
  font-size: 15px;
  color: var(--color-text-bright);
  margin-bottom: 4px;
}
.gallery-desc { 
  color: var(--color-muted); 
  font-size: 14px; 
  font-weight: 500;
  line-height: 1.4;
  
  /* Line clamp with fallbacks for maximum compatibility */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  
  /* Standard property for future compatibility */
  line-clamp: 2;
  
  /* Fallback height for browsers without line-clamp support */
  max-height: 2.8em; /* Approximate height for 2 lines with 1.4 line-height */
  position: relative;
}

/* Enhanced fallback for browsers that don't support line-clamp */
@supports not (line-clamp: 2) {
  .gallery-desc {
    display: block;
    overflow: hidden;
    max-height: 2.8em;
  }
  
  .gallery-desc::after {
    content: "...";
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, var(--color-surface));
    padding-left: 0.5em;
    color: var(--color-muted);
  }
}

.app-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 24px;
  padding: 16px 0;
  background: linear-gradient(to top, rgba(11,18,32,0.8), transparent);
}
.footer-text { color: var(--color-muted); font-size: 14px; }

.hidden { display: none !important; }

/* Video Player Styles */
.video-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-1);
}

.video-player {
  width: 100%;
  height: auto;
  max-height: 600px;
  background: #000;
  display: block;
  border-radius: var(--radius-lg);
}

.video-placeholder {
  width: 100%;
  height: 400px;
  background: var(--color-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 16px;
  border-radius: var(--radius-lg);
  font-weight: 500;
}

/* Retry Section Styles */
.retry-section {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: var(--shadow-1);
}

.retry-section .muted {
  margin-top: 8px;
  font-size: 14px;
}

/* Report Table Styles */
.report-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.report-header {
  margin-bottom: 20px;
}

.report-title {
  margin: 0;
  font-size: 20px;
  color: var(--color-text-bright);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.report-table-container {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface-2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.report-table th {
  background: linear-gradient(135deg, var(--color-surface-3), var(--color-surface-2));
  color: var(--color-text-bright);
  font-weight: 700;
  padding: 16px 12px;
  text-align: left;
  border-bottom: 2px solid var(--color-primary);
  font-size: 14px;
  position: sticky;
  top: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
}

.report-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.4;
  transition: background-color var(--transition-fast);
}

.report-table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

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

/* Loading states for video and table */
.loading-table {
  background: linear-gradient(90deg, var(--color-surface-3) 25%, var(--color-surface-2) 50%, var(--color-surface-3) 75%);
  background-size: 200% 100%;
  animation: loadingShine 2s infinite;
  border-radius: 8px;
}

@keyframes loadingShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Section transitions */
.results-content {
  animation: fadeInUp 0.6s ease-out;
}

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

/* Enhanced focus styles for video and interactive elements */
.video-player:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:focus-visible,
.form-input:focus-visible,
.mode-option:focus-visible,
.gallery-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Drag and Drop Styles */
.file-input-wrapper.drag-over {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.file-input-wrapper.drag-over .file-name {
  color: var(--color-primary);
}

/* Enhanced file input wrapper for better drag & drop visibility */
.file-input-wrapper {
  position: relative;
  transition: all var(--transition);
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--color-surface);
  border: 2px dashed var(--color-outline);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
}

.file-input-wrapper:hover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-name {
  flex: 1;
  color: var(--color-muted);
  font-size: 14px;
  transition: color var(--transition);
}

/* Gallery item hover enhancements */
.gallery-item {
  transition: all var(--transition);
  cursor: pointer;
}

.gallery-item:hover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(-2px);
}

.gallery-item:active {
  transform: translateY(0);
}

/* Focus styles for accessibility */
.gallery-item:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Selected gallery item state */
.gallery-item.selected {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.1);
}

/* Loading animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

.loading {
  animation: pulse 2s infinite;
}

.spinning {
  animation: spin 1s linear infinite;
}

/* Success and error states */
.success-state {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border-color: var(--color-success);
}

.error-state {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  border-color: var(--color-danger);
}

.warning-state {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
  border-color: var(--color-warning);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced responsive design */
@media (max-width: 768px) {
  .video-player {
    max-height: 400px;
  }
  
  .video-placeholder {
    height: 300px;
  }
  
  .report-table th,
  .report-table td {
    padding: 12px 8px;
    font-size: 13px;
  }
  
  .card {
    padding: 24px 20px;
  }
  
  .retry-section {
    padding: 20px 16px;
  }
}

@media (max-width: 640px) {
  .brand-title { font-size: 20px; }
  .section-header h2 { font-size: 18px; }
  .results-grid { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .mode-toggle { grid-template-columns: 1fr; gap: 6px; }
  .mode-option { padding: 10px 12px; font-size: 13px; }
  .btn { padding: 12px 16px; font-size: 13px; }
  
  .video-player {
    max-height: 300px;
  }
  
  .video-placeholder {
    height: 250px;
    font-size: 14px;
  }
  
  .report-container {
    padding: 20px 16px;
  }
  
  .report-table {
    min-width: 500px;
  }
  
  .retry-section {
    padding: 16px 12px;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .card { padding: 16px; margin-bottom: 20px; }
  .brand-title { font-size: 18px; }
  .brand-subtitle { font-size: 12px; }
  .logo { font-size: 24px; }
  
  .video-player {
    max-height: 250px;
  }
  
  .video-placeholder {
    height: 200px;
    font-size: 13px;
  }
  
  .report-container {
    padding: 16px 12px;
  }
  
  .report-table {
    min-width: 400px;
  }
  
  .report-table th,
  .report-table td {
    padding: 10px 6px;
    font-size: 12px;
  }
  
  .retry-section {
    padding: 12px 8px;
  }
  
  .retry-section .muted {
    font-size: 12px;
  }
}
