/* ==========================================================================
   Clinical Report & Interactive Homework Styles
   تنسيقات التقرير الإكلينيكي الشامل والواجب المنزلي التفاعلي
   ========================================================================== */

/* Report Styles */
.clinical-report-container {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 1080px;
  margin: 1.5rem auto;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--primary-100);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
}

.report-logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-900);
}

.report-badge {
  display: inline-block;
  background: var(--primary-50);
  color: var(--primary-700);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 4px;
}

.report-date-box {
  background: var(--bg-card-subtle);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.date-label {
  color: var(--text-muted);
  margin-left: 6px;
}

.date-val {
  font-weight: 700;
}

/* Metadata Grid */
.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.meta-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.meta-card.highlight {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.meta-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-val {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: 4px;
}

.meta-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* Sections */
.report-section {
  margin-bottom: 2.25rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-900);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-color);
}

/* Comparison Bar */
.progress-comparison-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  background: var(--bg-main);
  padding: 1.5rem;
  border-radius: var(--radius-md);
}

.comp-label {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.comp-bar-wrapper {
  background: #e2e8f0;
  height: 28px;
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.comp-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease-out;
}

.baseline-bar {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.post-bar {
  background: linear-gradient(90deg, #10b981, #059669);
}

.comp-percent {
  position: absolute;
  left: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #1e293b;
}

.comp-detail {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cue Distribution Grid */
.cue-distribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.cue-stat-box {
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border-color);
  background: #fff;
}

.cue-stat-box.green { border-color: #86efac; background: #f0fdf4; }
.cue-stat-box.blue { border-color: #bfdbfe; background: #eff6ff; }
.cue-stat-box.purple { border-color: #ddd6fe; background: #f5f3ff; }
.cue-stat-box.yellow { border-color: #fde68a; background: #fefce8; }
.cue-stat-box.cyan { border-color: #a5f3fc; background: #ecfeff; }
.cue-stat-box.red { border-color: #fecaca; background: #fef2f2; }

.cue-stat-num {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.cue-stat-name {
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 4px;
}

.cue-stat-box small {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Report Table */
.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.report-table th, .report-table td {
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.report-table th {
  background: var(--bg-card-subtle);
  font-weight: 800;
  color: var(--text-muted);
}

.status-pill {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

.pill-green { background: #dcfce7; color: #166534; }
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-amber { background: #fef3c7; color: #92400e; }

.cue-pill {
  background: #f1f5f9;
  color: #334155;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { color: #10b981; font-weight: 700; }
.badge-followup { color: #f59e0b; font-weight: 700; }

/* Notes Split Grid */
.split-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.notes-box {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.notes-box.highlight-box {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.notes-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.notes-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #334155;
}

.stumbled-tags {
  margin-top: 1rem;
}

.tag-title {
  font-size: 0.8rem;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.stumble-tag {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 4px;
}

.rec-list {
  padding-right: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.7;
}

/* Report Footer */
.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.sig-line {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sig-name {
  font-weight: 800;
  font-size: 0.95rem;
}

.btn-print {
  background: #1e293b;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   Interactive Homework Styles
   ========================================================================== */
.homework-container {
  max-width: 1080px;
  margin: 1.5rem auto;
}

.hw-hero-banner {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.3);
}

.hw-title {
  font-size: 2rem;
  font-weight: 900;
  margin-top: 0.5rem;
}

.hw-subtitle {
  font-size: 1.05rem;
  opacity: 0.9;
}

.parent-guide-card {
  background: #fffbeb;
  border: 2px solid #fef08a;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 15px;
  margin-bottom: 1.5rem;
}

.guide-icon {
  font-size: 2.5rem;
}

.guide-content h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #854d0e;
}

.guide-content p {
  font-size: 0.85rem;
  color: #713f12;
  margin-top: 2px;
}

/* Tabs */
.hw-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.hw-tab {
  background: #fff;
  border: 1.5px solid var(--border-color);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.hw-tab.active {
  background: var(--primary-600);
  color: #fff;
  border-color: var(--primary-700);
}

.hw-tab-content {
  display: none;
}

.hw-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* 3D Flip Card System */
.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.hw-card {
  height: 340px;
  perspective: 1000px;
}

.hw-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.hw-card.flipped .hw-card-inner {
  transform: rotateY(180deg);
}

.hw-card-front, .hw-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-lg);
  background: #fff;
  border: 1px solid var(--border-color);
  border-top-width: 6px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.hw-card-back {
  transform: rotateY(180deg);
  background: #f8fafc;
  align-items: stretch;
}

.hw-card-svg {
  width: 110px;
  height: 110px;
}

.hw-card-name {
  font-size: 1.6rem;
  font-weight: 900;
}

.hw-action-btns {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 6px;
}

.hw-btn-audio {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hw-btn-flip {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  padding: 6px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

/* Mystery Game Styles */
.mystery-game-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.mystery-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.mystery-badge {
  background: #fdf2f8;
  color: #db2777;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
}

.mystery-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.q-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 4px;
}

.mystery-options {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn-mystery-opt {
  background: #fff;
  border: 2px solid var(--border-color);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-mystery-opt.correct {
  background: #10b981;
  color: #fff;
  border-color: #059669;
}

.btn-mystery-opt.wrong {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
}

/* Sentence challenge */
.sentences-game-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.sentence-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.sentence-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0.5rem 0;
}

.btn-s-speak {
  background: #dbeafe;
  color: #1e40af;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hw-complete-box {
  text-align: center;
  margin-top: 2rem;
}

.btn-hw-complete {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

/* Print Optimization */
@media print {
  body {
    background: #fff !important;
  }
  .app-header, .stage-progress-bar, .no-print, .hw-tabs, .btn-print {
    display: none !important;
  }
  .clinical-report-container {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
}
