/* ============================================
   Kaizen Labs - Theme Components
   ============================================
   Version: 2.0.0
   Created: 2025-11-22

   Reusable component classes built on theme.css
   Uses BEM naming convention for consistency

   Depends on: theme.css
   ============================================ */

/* ==========================================
   BUTTONS
   ========================================== */

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

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

/* Button Sizes */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* Button Variants */
.btn--primary {
  background: var(--gradient-primary);
  color: var(--text-white);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn--secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--brand-primary);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg-white-5);
  border-color: var(--border-color-hover);
}

.btn--danger {
  background: var(--gradient-error);
  color: var(--text-white);
}

.btn--danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--glow-error);
}

.btn--success {
  background: var(--gradient-success);
  color: var(--text-white);
}

.btn--success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--glow-success);
}

.btn--quest {
  background: var(--gradient-quest);
  color: var(--text-white);
}

.btn--quest:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--glow-quest);
}

/* Icon-only Button */
.btn--icon {
  padding: var(--space-2);
  min-width: 36px;
  min-height: 36px;
}

.btn--icon.btn--sm {
  min-width: 28px;
  min-height: 28px;
  padding: var(--space-1-5);
}

.btn--icon.btn--lg {
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2-5);
}

/* Button Icon Styling */
.btn .material-symbols-rounded {
  font-size: 18px;
}

.btn--sm .material-symbols-rounded {
  font-size: 16px;
}

.btn--lg .material-symbols-rounded {
  font-size: 20px;
}

/* ==========================================
   CARDS
   ========================================== */

/* Base Card */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.card--elevated {
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-lg);
}

.card--interactive {
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-color-hover);
}

.card--interactive:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus), var(--shadow-xl);
}

/* Card Variants */
.card--quest {
  border-left: 4px solid var(--quest-primary);
}

.card--success {
  border-left: 4px solid var(--success);
  background: var(--success-bg);
}

.card--warning {
  border-left: 4px solid var(--warning);
  background: var(--warning-bg);
}

.card--error {
  border-left: 4px solid var(--error);
  background: var(--error-bg);
}

.card--info {
  border-left: 4px solid var(--info);
  background: var(--info-bg);
}

/* Card Header */
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.card__title-icon {
  font-size: 24px;
  color: var(--brand-primary);
}

/* Card Body */
.card__body {
  color: var(--text-secondary);
}

/* Card Footer */
.card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-color);
}

/* ==========================================
   BADGES
   ========================================== */

/* Base Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2-5);
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1.2;
  border-radius: var(--radius-sm-md);
  white-space: nowrap;
}

/* Badge Variants */
.badge--primary {
  background: var(--primary-15);
  color: var(--brand-primary);
}

.badge--success {
  background: var(--success-bg);
  color: var(--success);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge--error {
  background: var(--error-bg);
  color: var(--error);
}

.badge--info {
  background: var(--info-bg);
  color: var(--info);
}

.badge--quest {
  background: var(--ai-bg);
  color: var(--quest-primary);
}

.badge--neutral {
  background: var(--bg-white-10);
  color: var(--text-secondary);
}

/* Status Badges */
.badge--missing {
  background: var(--status-missing-bg);
  color: var(--status-missing);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge--late {
  background: var(--status-late-bg);
  color: var(--status-late);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge--incomplete {
  background: var(--warning-bg);
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge--submitted {
  background: var(--status-submitted-bg);
  color: var(--status-submitted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Urgency Badges */
.badge--urgency-overdue {
  background: var(--urgency-overdue-bg);
  color: var(--urgency-overdue);
}

.badge--urgency-today {
  background: var(--urgency-today-bg);
  color: var(--urgency-today);
}

.badge--urgency-tomorrow {
  background: var(--urgency-tomorrow-bg);
  color: var(--urgency-tomorrow);
}

.badge--urgency-week {
  background: var(--urgency-this-week-bg);
  color: var(--urgency-this-week);
}

.badge--urgency-soon {
  background: var(--urgency-soon-bg);
  color: var(--urgency-soon);
}

/* Priority Badges */
.badge--priority-critical {
  background: var(--priority-critical-bg);
  color: var(--priority-critical);
}

.badge--priority-high {
  background: var(--priority-high-bg);
  color: var(--priority-high);
}

.badge--priority-medium {
  background: var(--priority-medium-bg);
  color: var(--priority-medium);
}

.badge--priority-low {
  background: var(--priority-low-bg);
  color: var(--priority-low);
}

/* Badge with Icon */
.badge .material-symbols-rounded {
  font-size: 14px;
}

/* Pill Badge */
.badge--pill {
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
}

/* ==========================================
   FORM INPUTS
   ========================================== */

/* Input Base */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input:hover {
  border-color: var(--border-color-hover);
}

.input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-focus);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-tertiary);
}

/* Input with Icon */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group__icon {
  position: absolute;
  left: var(--space-3);
  font-size: 20px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.input-group .input {
  padding-left: calc(var(--space-3) + 20px + var(--space-2));
}

/* Input Error State */
.input--error {
  border-color: var(--error);
}

.input--error:focus {
  box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.3);
}

/* Input Success State */
.input--success {
  border-color: var(--success);
}

.input--success:focus {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23A0A0A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
  padding-right: calc(var(--space-3) + 16px + var(--space-2));
}

/* Textarea */
.textarea {
  min-height: 100px;
  resize: vertical;
}

/* ==========================================
   PROGRESS BARS
   ========================================== */

/* Progress Container */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-white-10);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress--sm {
  height: 4px;
}

.progress--lg {
  height: 12px;
}

/* Progress Fill */
.progress__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.progress__fill--primary {
  background: var(--gradient-primary);
}

.progress__fill--success {
  background: var(--gradient-success);
}

.progress__fill--warning {
  background: var(--gradient-warning);
}

.progress__fill--error {
  background: var(--gradient-error);
}

.progress__fill--quest {
  background: var(--gradient-quest);
}

/* Urgency Progress Fills */
.progress__fill--urgency {
  background: linear-gradient(90deg, var(--error) 0%, var(--error-light) 100%);
}

.progress__fill--importance {
  background: linear-gradient(90deg, var(--warning) 0%, var(--warning-light) 100%);
}

.progress__fill--performance {
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
}

.progress__fill--foundational {
  background: linear-gradient(90deg, var(--quest-primary) 0%, var(--quest-primary-light) 100%);
}

/* ==========================================
   EMPTY STATES
   ========================================== */

.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-state__icon {
  font-size: 64px;
  opacity: 0.5;
  display: block;
  margin-bottom: var(--space-4);
}

.empty-state__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
}

.empty-state__description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

.empty-state__action {
  margin-top: var(--space-6);
}

/* ==========================================
   LOADING STATES
   ========================================== */

.loading-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-secondary);
}

.loading-state__spinner {
  font-size: 48px;
  display: block;
  margin-bottom: var(--space-4);
  animation: spin 1s linear infinite;
}

.loading-state__text {
  font-size: var(--text-lg);
  margin: 0;
}

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

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-white-5) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton--text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton--title {
  height: 1.5em;
  width: 60%;
  margin-bottom: var(--space-3);
}

.skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton--card {
  height: 120px;
}

/* ==========================================
   ALERTS & BANNERS
   ========================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border-left: 4px solid;
}

.alert__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.alert__content {
  flex: 1;
}

.alert__title {
  font-weight: var(--font-semibold);
  margin: 0 0 var(--space-1) 0;
}

.alert__message {
  font-size: var(--text-sm);
  margin: 0;
}

/* Alert Variants */
.alert--info {
  background: var(--info-bg);
  border-color: var(--info);
}

.alert--info .alert__icon {
  color: var(--info);
}

.alert--success {
  background: var(--success-bg);
  border-color: var(--success);
}

.alert--success .alert__icon {
  color: var(--success);
}

.alert--warning {
  background: var(--warning-bg);
  border-color: var(--warning);
}

.alert--warning .alert__icon {
  color: var(--warning);
}

.alert--error {
  background: var(--error-bg);
  border-color: var(--error);
}

.alert--error .alert__icon {
  color: var(--error);
}

/* ==========================================
   STAT CARDS
   ========================================== */

.stat-card {
  background: var(--bg-secondary);
  border-left: 4px solid;
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.stat-card--quest {
  background: var(--primary-15);
  border-left-color: var(--brand-primary);
}

.stat-card--success {
  background: var(--success-bg);
  border-left-color: var(--success);
}

.stat-card--neutral {
  background: var(--bg-white-10);
  border-left-color: var(--text-gray-700);
}

.stat-card--warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.stat-card__value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
}

.stat-card--quest .stat-card__value {
  color: var(--brand-primary);
}

.stat-card--success .stat-card__value {
  color: var(--success);
}

.stat-card--neutral .stat-card__value {
  color: var(--text-gray-800);
}

.stat-card--warning .stat-card__value {
  color: var(--warning);
}

/* ==========================================
   XP & ACHIEVEMENT BADGES
   ========================================== */

.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--gradient-quest);
  color: var(--text-white);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
}

.xp-badge .material-symbols-rounded {
  font-size: 16px;
}

.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1a1a1a;
  font-weight: var(--font-semibold);
  border-radius: var(--radius-md);
}

.achievement-badge .material-symbols-rounded {
  font-size: 20px;
}

/* ==========================================
   DROPDOWN MENUS
   ========================================== */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown__trigger {
  cursor: pointer;
}

.dropdown__menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration-fast) var(--ease-out);
  z-index: var(--z-dropdown);
}

.dropdown--open .dropdown__menu,
.dropdown__menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--duration-fast);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.dropdown__item:hover {
  background: var(--bg-white-5);
}

.dropdown__item.active {
  background: var(--primary-15);
  color: var(--brand-primary);
}

.dropdown__item .material-symbols-rounded {
  font-size: 20px;
}

.dropdown__divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-2) 0;
}

.dropdown__label {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==========================================
   MODALS
   ========================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-black-70);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  max-width: 90vw;
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
}

.modal__title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.modal__close:hover {
  background: var(--bg-white-10);
  color: var(--text-primary);
}

.modal__body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

/* Modal Sizes */
.modal--sm {
  width: 400px;
}

.modal--md {
  width: 560px;
}

.modal--lg {
  width: 800px;
}

.modal--xl {
  width: 1000px;
}

/* ==========================================
   TOOLTIPS
   ========================================== */

.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-fast);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-lg);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ==========================================
   QUEST ITEM CARDS
   ========================================== */

.quest-item {
  position: relative;
  background: var(--bg-white-3);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  border-left: 4px solid var(--quest-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

.quest-item:hover {
  background: var(--bg-white-5);
}

.quest-item--pending {
  border-left-color: var(--quest-pending);
}

.quest-item--in-progress {
  border-left-color: var(--quest-in-progress);
}

.quest-item--completed {
  border-left-color: var(--quest-completed);
}

.quest-item--approved {
  border-left-color: var(--quest-approved);
}

.quest-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.quest-item__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.quest-item__xp {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--quest-primary);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.quest-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.quest-item__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.quest-item__meta-item .material-symbols-rounded {
  font-size: 16px;
}

/* ==========================================
   GRID LAYOUTS
   ========================================== */

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid--cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.grid--auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--auto-fill {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* Responsive Grid */
@media (max-width: 768px) {
  .grid--cols-2,
  .grid--cols-3,
  .grid--cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .grid--cols-3,
  .grid--cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================
   FLEXBOX UTILITIES
   ========================================== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ==========================================
   VISIBILITY UTILITIES
   ========================================== */

.hidden { display: none !important; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================
   ICON ANIMATIONS
   ========================================== */

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

.icon--pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Note: @keyframes spin already defined at line 608 */

/* ==========================================
   STATUS INDICATORS
   ========================================== */

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.status-dot--lg {
  width: 14px;
  height: 14px;
}

.status-dot--active,
.status-dot--success { background: var(--success); }
.status-dot--warning { background: var(--warning); }
.status-dot--error { background: var(--error); }
.status-dot--info { background: var(--info); }
.status-dot--neutral { background: var(--gray-500); }
.status-dot--primary { background: var(--brand-primary); }

/* ==========================================
   ENVIRONMENT BANNERS
   ========================================== */

.env-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  font-weight: var(--font-semibold);
  gap: var(--space-2);
  font-family: var(--font-primary);
}

.env-banner--dev {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: white;
}

.env-banner--staging {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
  color: white;
}

.env-banner--scraper {
  background: linear-gradient(90deg, #10b981, #059669);
  color: white;
}

.env-banner__icon {
  font-size: 18px;
}

.env-banner__text {
  font-size: var(--text-sm);
}

/* ==========================================
   SPACING UTILITIES
   ========================================== */

/* Margin */
.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }
.ml-6 { margin-left: var(--space-6); }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: var(--space-1); padding-right: var(--space-1); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: var(--space-1); padding-bottom: var(--space-1); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* ==========================================
   TEXT UTILITIES
   ========================================== */

/* Text colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

/* Text sizes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

/* Text weights */
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ==========================================
   WIDTH/HEIGHT UTILITIES
   ========================================== */

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }

/* Max width */
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-full { max-width: 100%; }

/* Height */
.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }

/* Max height with overflow */
.max-h-200 { max-height: 200px; overflow-y: auto; }
.max-h-300 { max-height: 300px; overflow-y: auto; }
.max-h-400 { max-height: 400px; overflow-y: auto; }

/* ==========================================
   BORDER UTILITIES
   ========================================== */

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--border-color); }
.border-0 { border: none; }

/* ==========================================
   BACKGROUND UTILITIES
   ========================================== */

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.bg-transparent { background: transparent; }

/* Glassmorphic backgrounds */
.bg-glass {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bg-glass-strong {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   CURSOR UTILITIES
   ========================================== */

.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* ==========================================
   OVERFLOW UTILITIES
   ========================================== */

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }

/* ==========================================
   FEEDBACK MODAL STYLES
   ========================================== */

.feedback-modal-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-md-lg);
  padding: var(--space-6);
}

.feedback-section {
  margin-bottom: var(--space-6);
}

.feedback-label {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  display: block;
  margin-bottom: var(--space-2);
  font-family: var(--font-primary);
}

.feedback-select,
.feedback-input,
.feedback-textarea {
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
}

.feedback-textarea {
  min-height: 150px;
  resize: vertical;
}

.feedback-textarea--sm {
  min-height: 100px;
}

.feedback-textarea--xs {
  min-height: 80px;
}

.feedback-hint {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  font-family: var(--font-primary);
}

.feedback-context-box {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--primary-5);
  border: 1px solid var(--primary-20);
  border-radius: var(--radius-md);
}

.feedback-checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.feedback-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand-primary);
}

.feedback-checkbox-label {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-primary);
  cursor: pointer;
  user-select: none;
}

.feedback-details-summary {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-family: var(--font-primary);
  cursor: pointer;
  user-select: none;
  padding: var(--space-1) 0;
}

.feedback-context-preview {
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-primary);
  border-radius: var(--radius-sm-md);
  border: 1px solid var(--bg-white-5);
}

.feedback-context-preview pre {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-family: 'Courier New', monospace;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.feedback-info-text {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-2);
  font-family: var(--font-primary);
  line-height: var(--leading-relaxed);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.feedback-info-text .material-symbols-rounded {
  font-size: 14px;
  color: var(--info);
}

/* Emoji icon sizes */
.emoji-icon {
  font-size: 16px;
  line-height: 1;
}

.emoji-icon--lg {
  font-size: 18px;
}

/* Environment banner content layout */
.env-banner__content {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.env-banner__details {
  margin-left: var(--space-4);
  font-weight: var(--font-normal);
  opacity: 0.9;
  font-size: var(--text-xs);
}

/* Spacer utility for banner offset */
.spacer-banner-sm {
  height: 35px;
}

.spacer-banner-lg {
  height: 40px;
}

/* ==========================================
   TOOLTIP BADGE EXAMPLES
   ========================================== */

.tooltip-badge-example {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-sm);
}

.tooltip-badge-example--missing {
  background: rgba(217, 107, 138, 0.15);
  color: var(--color-alert);
  border: 1px solid rgba(217, 107, 138, 0.3);
}

.tooltip-badge-example--late {
  background: rgba(255, 152, 0, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.tooltip-badge-example--high-stakes {
  background: var(--primary-15);
  color: var(--brand-primary);
  border: 1px solid var(--primary-30);
}

.tooltip-badge-example--ai-quest {
  background: var(--primary-20);
  color: var(--brand-primary);
  border: 1px solid var(--primary-40);
}

.tooltip-badge-example--ai-file {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(102, 187, 106, 0.3);
}

.tooltip-badge-example--ai-junk {
  background: rgba(158, 158, 158, 0.15);
  color: #9E9E9E;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

/* ==========================================
   MODAL ENHANCEMENTS
   ========================================== */

.modal__title-icon {
  color: var(--brand-primary);
  margin-right: var(--space-2);
}

/* Info cards for modals */
.info-card {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  background: var(--bg-white-2);
  border: 1px solid var(--bg-white-5);
}

.info-card--primary {
  background: var(--primary-10);
  border: 1px solid var(--primary-30);
}

.info-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  font-weight: var(--font-semibold);
}

.info-card__body {
  margin-left: 24px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.info-card__note {
  margin-left: 24px;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* Prompt input styling */
.prompt-input {
  border: 1px solid var(--border-color);
  background: var(--bg-white-5);
  font-family: var(--font-primary);
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.prompt-input::placeholder {
  color: var(--text-tertiary);
}

/* Assignment course color - use CSS variable */
.assignment-course[style*="color:"] {
  /* Allow inline color but ensure consistency */
}

/* Animation override utility */
.no-animation {
  animation: none !important;
}

/* ==========================================
   AI SUGGESTION COMPONENTS
   (Used in parent.html modals for steps/chunks)
   ========================================== */

/* Step/Chunk preview item in modal */
.ai-step-preview-item {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-white-2);
  border: 1px solid var(--bg-white-5);
  border-radius: var(--radius-md);
}

.ai-step-preview-item__number {
  font-weight: var(--font-semibold);
  color: var(--brand-primary);
}

.ai-step-preview-item__name {
  font-weight: var(--font-medium);
  color: var(--brand-primary);
}

.ai-step-preview-item__description {
  margin-left: 24px;
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.ai-step-preview-item__time {
  margin-left: 24px;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* AI suggestion header banner */
.ai-suggestion-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: var(--primary-10);
  border: 1px solid var(--primary-30);
  border-radius: var(--radius-md);
}

.ai-suggestion-banner__icon {
  color: var(--brand-primary);
}

.ai-suggestion-banner__title {
  font-weight: var(--font-medium);
  color: var(--brand-primary);
}

.ai-suggestion-banner__subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Scrollable list container */
.scrollable-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: var(--space-4);
}

.scrollable-list--sm {
  max-height: 300px;
}

.scrollable-list--lg {
  max-height: 500px;
}

/* Info note box */
.info-note {
  padding: var(--space-3);
  background: var(--bg-white-2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.info-note .material-symbols-rounded {
  color: var(--info);
  font-size: 16px;
  vertical-align: middle;
}

/* Date picker input styling */
.date-picker-input {
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  background: var(--bg-white-5);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-primary);
}

.date-picker-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-focus);
}

/* Date picker hint text */
.date-picker-hint {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Fixed width date input (for chunk modal) */
.date-input-fixed {
  width: 150px;
  margin-top: var(--space-2);
}

/* Message with bottom margin */
.modal-message {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

/* Align middle for inline icons */
.icon-align-middle {
  vertical-align: middle;
}

/* Confidence/progress fill modifier for complexity */
.confidence-fill--complexity {
  background: var(--text-secondary);
}

/* ==========================================
   ICON COLOR UTILITIES
   ========================================== */

.icon--primary { color: var(--brand-primary); }
.icon--success { color: var(--success); }
.icon--error { color: var(--error); }
.icon--warning { color: var(--warning); }
.icon--info { color: var(--info); }
.icon--purple { color: var(--accent-purple, var(--quest-primary)); }
.icon--yellow { color: var(--accent-yellow, var(--warning)); }
.icon--green { color: var(--accent-green, var(--success)); }
.icon--blue { color: var(--accent-blue, var(--brand-primary)); }
.icon--muted { color: var(--text-muted); }

/* Icon size modifiers */
.icon--sm { font-size: 16px; }
.icon--md { font-size: 20px; }
.icon--lg { font-size: 24px; }
.icon--xl { font-size: 32px; }

/* ==========================================
   QUEST COMPLETION STATES
   ========================================== */

/* Text size for completion messages */
.text-completion {
  font-size: 1.2rem;
}
