/* GradeLoop App UI — complements theme.css */

.app-nav {
  background: var(--fg);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}

.app-nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.app-nav-links a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.app-nav-links a:hover {
  color: var(--white);
}

.app-nav-links a.active {
  color: var(--white);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: #dc2626;
  color: var(--white);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* App container */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px;
}

/* Page title */
.page-title {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-style: italic;
  color: var(--fg);
  margin-bottom: 8px;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin-bottom: 40px;
}

/* Status banners */
.status-banner {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-banner.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.status-banner.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.status-banner.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.status-banner.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Card */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

/* Form elements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--fg);
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

/* Step wizard */
.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.wizard-step {
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-step:hover { color: var(--fg); }

.wizard-step.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.wizard-step.done {
  color: var(--accent-light);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  color: var(--fg-muted);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-step.active .step-num {
  background: var(--accent);
  color: var(--white);
}

.wizard-step.done .step-num {
  background: var(--accent-light);
  color: var(--white);
}

/* Progress bar */
.progress-wrap {
  margin: 24px 0;
}

.progress-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.progress-bar {
  height: 8px;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Results table */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.results-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-alt);
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.results-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}

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

.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.score-badge.high { background: #dcfce7; color: #166534; }
.score-badge.mid { background: #fffbeb; color: #92400e; }
.score-badge.low { background: #fef2f2; color: #991b1b; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.pending { background: var(--bg-alt); color: var(--fg-muted); }
.status-badge.running { background: #eff6ff; color: #1e40af; }
.status-badge.completed { background: #dcfce7; color: #166534; }
.status-badge.failed { background: #fef2f2; color: #991b1b; }

/* Rubric preview */
.rubric-item {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 3px solid var(--accent);
}

.rubric-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.rubric-item-desc {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.rubric-item-pts {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

/* Connect canvas */
.canvas-connect-card {
  text-align: center;
  padding: 48px 32px;
}

.canvas-connect-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--bg-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-connect-title {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-style: italic;
  margin-bottom: 10px;
}

.canvas-connect-desc {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #dcfce7;
  color: #166534;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Expand/collapse */
.feedback-expand {
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  padding: 6px 0;
}

.feedback-detail {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-top: 6px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* Loading spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* Check icon */
.icon-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #166534;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer spacing */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 32px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
}