/* ===== SDI Scaffold Engine — Shared Styles ===== */

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}

/* Navigation Links */
.nav-link {
  color: #94a3b8;
}
.nav-link:hover {
  background: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
}
.nav-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.15);
}
.nav-link.active i {
  color: #60a5fa;
}

/* Stat Cards */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.07;
  pointer-events: none;
  transition: opacity 0.3s;
}
.stat-card:nth-child(1)::before { background: #3b82f6; }
.stat-card:nth-child(2)::before { background: #6366f1; }
.stat-card:nth-child(3)::before { background: #06b6d4; }
.stat-card:nth-child(4)::before { background: #10b981; }
.stat-card:hover::before { opacity: 0.12; }

/* Smooth transitions for all interactive elements */
button, a, input, select, textarea {
  transition-property: color, background-color, border-color, box-shadow, opacity, transform;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles */
input:focus, textarea:focus, select:focus {
  outline: none;
}

/* Body */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
}

/* Animation keyframes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out both;
}

/* Staggered animations */
.animate-fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.animate-fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.animate-fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.animate-fade-in-up:nth-child(4) { animation-delay: 0.2s; }
.animate-fade-in-up:nth-child(5) { animation-delay: 0.25s; }
.animate-fade-in-up:nth-child(6) { animation-delay: 0.3s; }

/* Accommodation toggle */
.accom-toggle {
  user-select: none;
}
.accom-toggle.selected {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.35);
}
.accom-toggle.selected .accom-icon {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
.accom-toggle.selected .accom-check {
  opacity: 1;
  transform: scale(1);
}

/* Level tab active states */
.level-tab[data-level="1"].active {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}
.level-tab[data-level="2"].active {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}
.level-tab[data-level="3"].active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

/* Print styles for export */
@media print {
  aside, header, .no-print { display: none !important; }
  main { margin-left: 0 !important; padding: 0 !important; }
  body { background: white !important; color: black !important; }
}

/* Worksheet preview styles */
.worksheet-preview {
  font-family: 'Inter', sans-serif;
}
.worksheet-preview .ws-header {
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.worksheet-preview .ws-title {
  font-family: 'Days One', sans-serif;
  font-size: 16px;
  color: #e2e8f0;
  margin-bottom: 4px;
}
.worksheet-preview .ws-subtitle {
  font-size: 11px;
  color: #64748b;
}

/* Export Center styles */
.export-format-card {
  position: relative;
  overflow: hidden;
}
.export-format-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.06;
  pointer-events: none;
  transition: opacity 0.3s;
}
.export-format-card:hover::before { opacity: 0.12; }
.export-format-card.selected {
  border-color: rgba(59, 130, 246, 0.5) !important;
  background: rgba(59, 130, 246, 0.08) !important;
}
.export-format-card.selected .format-radio {
  background: #3b82f6;
  border-color: #3b82f6;
}
.export-format-card.selected .format-radio-inner {
  opacity: 1;
  transform: scale(1);
}

/* Document preview paper style */
.doc-preview {
  background: #0f172a;
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.doc-preview-page {
  background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,41,59,0.95));
  border: 1px solid rgba(51,65,85,0.3);
  border-radius: 8px;
  padding: 24px;
  margin: 16px;
  position: relative;
  min-height: 400px;
}
.doc-preview-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, #3b82f6, #6366f1);
  border-radius: 8px 8px 0 0;
}

/* M-Powered brand bar */
.mp-brand-bar {
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(99,102,241,0.08));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.worksheet-preview .ws-section {
  margin-bottom: 20px;
}
.worksheet-preview .ws-section-title {
  font-family: 'Days One', sans-serif;
  font-size: 12px;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}
.worksheet-preview .ws-chunk {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
}
.worksheet-preview .ws-chunk-label {
  font-family: 'Days One', sans-serif;
  font-size: 10px;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
}
.worksheet-preview .ws-stem {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid #6366f1;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #c7d2fe;
  font-style: italic;
}
.worksheet-preview .ws-vocab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 8px;
  padding: 6px 12px;
  margin: 3px;
  font-size: 12px;
  color: #67e8f9;
}
.worksheet-preview .ws-vocab-def {
  font-size: 11px;
  color: #64748b;
  font-style: italic;
}
.worksheet-preview .ws-blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 1px dashed #475569;
  margin: 0 4px;
}
.worksheet-preview .ws-text-simplified {
  font-size: 13px;
  line-height: 1.8;
  color: #e2e8f0;
}
.worksheet-preview .ws-text-simplified .highlight {
  background: rgba(245, 158, 11, 0.15);
  border-bottom: 1px dashed rgba(245, 158, 11, 0.4);
  padding: 0 2px;
}
.worksheet-preview .ws-text-simplified .vocab-scaffold {
  text-decoration: underline dotted;
  text-decoration-color: rgba(96, 165, 250, 0.6);
  text-underline-offset: 3px;
  cursor: help;
  color: #93c5fd;
  font-weight: 700;
}
.worksheet-preview .ws-question {
  background: rgba(30, 41, 59, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #cbd5e1;
}
.worksheet-preview .ws-question-num {
  font-family: 'Days One', sans-serif;
  color: #60a5fa;
  margin-right: 8px;
}
.worksheet-preview .ws-answer-area {
  border: 1px dashed rgba(100, 116, 139, 0.3);
  border-radius: 8px;
  min-height: 40px;
  margin-top: 8px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.3);
}

/* Visual Vocabulary Cards */
.worksheet-preview .ws-vocab-card {
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.worksheet-preview .ws-vocab-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
}
.worksheet-preview .ws-vocab-word {
  font-family: 'Days One', sans-serif;
  font-size: 14px;
  color: #67e8f9;
  margin-bottom: 4px;
}
.worksheet-preview .ws-vocab-def-text {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.5;
}
.worksheet-preview .ws-vocab-draw-area {
  border: 1.5px dashed rgba(100, 116, 139, 0.4);
  border-radius: 8px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  background: rgba(15, 23, 42, 0.2);
}
.worksheet-preview .ws-vocab-draw-label {
  font-size: 9px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.worksheet-preview .ws-vocab-draw-prompt {
  font-size: 10px;
  color: #64748b;
  font-style: italic;
}