/**
 * quick-action-strip.css
 * High-performance, mobile-first styling for immediate file preview action bar,
 * inline progress feedback, and decluttering of the exam solving workbench.
 * Platform: chamnhanh.net (AUTOGRADING)
 * Responsive range: 320px (Compact Mobile) -> 344px (Foldable) -> 390px -> 768px -> 1440px+
 * Strictly adheres to SOLID / SoC (<= 200 lines).
 */

/* 1. Declutter Studio Chrome for Standalone Exam Solving & Barem Modes */
#assessment-studio-view.focused-exam-barem-mode .ai-pedagogical-disclaimer,
#assessment-studio-view.focused-exam-barem-mode .studio-segmented-tabs-wrapper,
#assessment-studio-view.focused-exam-solution-mode .ai-pedagogical-disclaimer,
#assessment-studio-view.focused-exam-solution-mode .studio-segmented-tabs-wrapper {
  display: none !important;
}

/* 2. Immediate File Preview Action Bar (Direct CTA in preview strip) */
.quick-files-ready-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  margin-top: 0.45rem;
  border-radius: 8px;
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-color, #cbd5e1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  animation: fadeInActionBar 0.2s ease-out;
}

.quick-files-ready-info {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-main, #334155);
}

.quick-files-ready-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}

.quick-preview-submit-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 7px;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.quick-preview-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.quick-preview-submit-btn:disabled,
.quick-preview-submit-btn.is-busy {
  opacity: 0.65;
  cursor: not-allowed;
  pointer-events: none;
}

/* 3. Inline Animated Processing Feedback Banner */
.quick-inline-processing-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.95rem;
  margin-top: 0.55rem;
  margin-bottom: 0.55rem;
  border-radius: 9px;
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
  border: 1.5px solid #818cf8;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.12);
  animation: fadeInActionBar 0.22s ease-out;
}

.quick-inline-spinner {
  width: 18px;
  height: 18px;
  border: 2.2px solid #c7d2fe;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spinInlineBanner 0.75s linear infinite;
  flex-shrink: 0;
}

.quick-inline-status-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.4;
  flex: 1;
}

.btn-quick-cancel-inline {
  appearance: none;
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.btn-quick-cancel-inline:hover {
  background: #f1f5f9;
  color: #0f172a;
}

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

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

/* 4. Responsive Design (Mobile 320px - 640px) */
@media (max-width: 640px) {
  .quick-files-ready-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
  }

  .quick-files-ready-info {
    justify-content: space-between;
    width: 100%;
  }

  .quick-preview-submit-btn {
    width: 100%;
    min-height: 44px;
    font-size: 0.84rem;
  }

  .quick-inline-processing-banner {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
  }

  .quick-inline-status-text {
    font-size: 0.78rem;
  }
}

@media (max-width: 360px) {
  .quick-files-ready-action-bar {
    padding: 0.45rem 0.5rem;
  }

  .quick-preview-submit-btn {
    font-size: 0.78rem;
    padding: 0.45rem 0.6rem;
  }
}

/* 5. Dark Mode Parity */
[data-theme="dark"] .quick-files-ready-action-bar,
body.dark-mode .quick-files-ready-action-bar {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .quick-files-ready-info,
body.dark-mode .quick-files-ready-info {
  color: #e2e8f0;
}

[data-theme="dark"] .quick-inline-processing-banner,
body.dark-mode .quick-inline-processing-banner {
  background: rgba(30, 41, 59, 0.95);
  border-color: #6366f1;
}

[data-theme="dark"] .quick-inline-status-text,
body.dark-mode .quick-inline-status-text {
  color: #f1f5f9;
}

[data-theme="dark"] .btn-quick-cancel-inline,
body.dark-mode .btn-quick-cancel-inline {
  border-color: #475569;
  color: #94a3b8;
}
