/* ===========================================================
   PREMIUM MEDICAL TERMINOLOGY STYLING
   Enhanced Design System for Medical Education Content
   Version: 1.0 | February 2026
   =========================================================== */

/* -----------------------------------------------------------
   ENHANCED VARIABLES & COLOR SYSTEM
   ----------------------------------------------------------- */
:root {
  /* Medical Color Palette */
  --medical-primary: #0066cc;
  --medical-secondary: #00a896;
  --medical-accent: #6a4c93;
  --medical-warning: #f4a261;
  --medical-danger: #e76f51;
  --medical-success: #2a9d8f;
  
  /* Term Category Colors */
  --cardio-color: #e63946;
  --respiratory-color: #457b9d;
  --neuro-color: #9d4edd;
  --gi-color: #f4a261;
  --renal-color: #06aed5;
  --heme-color: #e76f51;
  --endo-color: #8ac926;
  --msk-color: #ff6b6b;
  
  /* Enhanced Shadows */
  --shadow-term: 0 2px 8px rgba(0, 102, 204, 0.08);
  --shadow-category: 0 4px 16px rgba(0, 102, 204, 0.12);
  --shadow-hover: 0 8px 24px rgba(0, 102, 204, 0.16);
}

/* -----------------------------------------------------------
   TERM CATEGORIES - SYSTEM-SPECIFIC STYLING
   ----------------------------------------------------------- */
.term-category {
  margin: 2.5rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  border-left: 4px solid var(--medical-primary);
  box-shadow: var(--shadow-category);
  transition: all 0.3s ease;
}

.term-category:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.term-category h4 {
  color: var(--medical-primary);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.term-category h4::before {
  content: "📌";
  font-size: 1.5rem;
}

/* -----------------------------------------------------------
   ENHANCED TABLE STYLING
   ----------------------------------------------------------- */
.table-responsive {
  margin: 1.5rem 0;
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: var(--shadow-term);
}

.table-responsive table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  font-size: 0.95rem;
}

.table-responsive thead {
  background: linear-gradient(135deg, var(--medical-primary) 0%, #0052a3 100%);
  color: white;
}

.table-responsive thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.table-responsive thead th:first-child {
  border-top-left-radius: 10px;
}

.table-responsive thead th:last-child {
  border-top-right-radius: 10px;
}

.table-responsive tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--color-gray-200);
}

.table-responsive tbody tr:hover {
  background-color: rgba(0, 102, 204, 0.03);
  transform: scale(1.01);
}

.table-responsive tbody tr:last-child {
  border-bottom: none;
}

.table-responsive tbody tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

.table-responsive tbody tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.table-responsive tbody td {
  padding: 1rem 1.25rem;
  vertical-align: top;
  line-height: 1.6;
}

.table-responsive tbody td:first-child {
  font-weight: 600;
  color: var(--medical-primary);
  background: rgba(0, 102, 204, 0.02);
}

.table-responsive tbody td strong {
  color: var(--medical-primary);
  font-weight: 700;
}

.table-responsive tbody td em {
  color: var(--medical-secondary);
  font-style: italic;
  background: rgba(0, 168, 150, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Responsive table on mobile */
@media (max-width: 768px) {
  .table-responsive table {
    font-size: 0.85rem;
  }
  
  .table-responsive thead th,
  .table-responsive tbody td {
    padding: 0.75rem 0.85rem;
  }
}

/* -----------------------------------------------------------
   CASE EXAMPLES - CLINICAL SCENARIOS
   ----------------------------------------------------------- */
.case-example {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #fff5eb 0%, #fff 100%);
  border-left: 5px solid var(--medical-warning);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(244, 162, 97, 0.15);
}

.case-example h4 {
  color: var(--medical-warning);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.case-example h4::before {
  content: "📋";
  font-size: 1.5rem;
}

.case-example p {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.case-example p strong {
  color: var(--medical-primary);
  font-weight: 700;
  display: inline-block;
  min-width: 120px;
}

.case-example ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.case-example ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* -----------------------------------------------------------
   ENHANCED CLINICAL PEARLS
   ----------------------------------------------------------- */
.clinical-pearl {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #e8f4f8 0%, #f0f9ff 100%);
  border-left: 4px solid var(--medical-secondary);
  border-radius: 10px;
  box-shadow: var(--shadow-term);
  font-size: 0.95rem;
  line-height: 1.7;
  position: relative;
  overflow: hidden;
}

.clinical-pearl::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -5%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(42, 157, 143, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.clinical-pearl strong {
  color: var(--medical-secondary);
  font-weight: 700;
}

/* Warning pearls */
.clinical-pearl:has(i.fa-exclamation-triangle),
.clinical-pearl:has(content="⚠️") {
  background: linear-gradient(135deg, #fff3cd 0%, #fff8e1 100%);
  border-left-color: var(--medical-warning);
}

/* -----------------------------------------------------------
   EMOJI HEADER STYLING
   ----------------------------------------------------------- */
.concept h3 .emoji {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.5em;
  vertical-align: middle;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* -----------------------------------------------------------
   ENHANCED CONCEPT CARDS
   ----------------------------------------------------------- */
.concept {
  background: white;
  padding: 2.5rem;
  margin: 2rem 0;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-gray-200);
  transition: all 0.3s ease;
}

.concept:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.concept h3 {
  color: var(--medical-primary);
  margin-bottom: 1.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.concept h4 {
  color: var(--medical-accent);
  font-size: 1.35rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-gray-200);
}

.concept p.small {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.concept ul {
  list-style: none;
  padding-left: 0;
  margin: 1.25rem 0;
}

.concept ul li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.concept ul li::before {
  content: "▸";
  position: absolute;
  left: 0.5rem;
  color: var(--medical-primary);
  font-weight: bold;
  font-size: 1.2em;
}

.concept ul li strong {
  color: var(--medical-primary);
  font-weight: 700;
}

/* -----------------------------------------------------------
   SPECIALTY BADGES
   ----------------------------------------------------------- */
.specialty-badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  margin: 0.25rem;
  background: linear-gradient(135deg, var(--medical-primary) 0%, #0052a3 100%);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
  transition: all 0.2s ease;
}

.specialty-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* -----------------------------------------------------------
   MEMORY AIDS & MNEMONICS
   ----------------------------------------------------------- */
.mnemonic-box {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f3e5f5 0%, #fce4ec 100%);
  border-left: 4px solid var(--medical-accent);
  border-radius: 10px;
  box-shadow: var(--shadow-term);
}

.mnemonic-box h5 {
  color: var(--medical-accent);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mnemonic-box p {
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.mnemonic-box strong {
  color: var(--medical-accent);
  font-weight: 700;
  font-size: 1.1em;
}

/* -----------------------------------------------------------
   INTERACTIVE ELEMENTS
   ----------------------------------------------------------- */
.term-highlight {
  background: linear-gradient(120deg, rgba(0, 102, 204, 0.1) 0%, rgba(0, 168, 150, 0.1) 100%);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  color: var(--medical-primary);
  transition: all 0.2s ease;
  cursor: help;
}

.term-highlight:hover {
  background: linear-gradient(120deg, rgba(0, 102, 204, 0.15) 0%, rgba(0, 168, 150, 0.15) 100%);
  transform: scale(1.02);
}

/* -----------------------------------------------------------
   SECTION DIVIDERS
   ----------------------------------------------------------- */
.section-divider {
  margin: 3rem 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--medical-primary) 50%, transparent 100%);
  border: none;
}

/* -----------------------------------------------------------
   QUICK REFERENCE CARDS
   ----------------------------------------------------------- */
.quick-ref-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.quick-ref-item {
  padding: 1.5rem;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-term);
  border-top: 3px solid var(--medical-primary);
  transition: all 0.3s ease;
}

.quick-ref-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.quick-ref-item h5 {
  color: var(--medical-primary);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.quick-ref-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* -----------------------------------------------------------
   RESPONSIVE ADJUSTMENTS
   ----------------------------------------------------------- */
@media (max-width: 768px) {
  .concept {
    padding: 1.5rem;
  }
  
  .term-category {
    padding: 1.25rem;
  }
  
  .case-example {
    padding: 1.25rem;
  }
  
  .clinical-pearl {
    padding: 1rem 1.25rem;
  }
  
  .quick-ref-card {
    grid-template-columns: 1fr;
  }
}

/* -----------------------------------------------------------
   PRINT STYLES
   ----------------------------------------------------------- */
@media print {
  .concept,
  .term-category,
  .case-example {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .table-responsive {
    overflow: visible;
  }
  
  .clinical-pearl {
    border: 1px solid var(--medical-secondary);
    box-shadow: none;
  }
}

/* -----------------------------------------------------------
   ACCESSIBILITY ENHANCEMENTS
   ----------------------------------------------------------- */
.term-category:focus-within,
.concept:focus-within,
.case-example:focus-within {
  outline: 3px solid var(--medical-primary);
  outline-offset: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .term-category,
  .concept,
  .case-example {
    border-width: 2px;
  }
  
  .table-responsive tbody tr:hover {
    background-color: rgba(0, 102, 204, 0.1);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}