/**
 * Signal Pilot Docs - Visual Enhancements
 * Callout boxes, visual breaks, and improved readability elements
 * Version: 1.1 - Responsive Optimizations
 * Created: November 2025
 * Updated: November 2025 - Added responsive Mermaid diagram styles
 * CACHE BUSTER: v2024-11-05-TARGETED-LARGE-DIAGRAMS
 */

/* ============================================
   CALLOUT BOXES
   ============================================ */

/* Base callout style */
.sp-callout {
  position: relative;
  margin: 1.5rem 0;
  padding: 1rem 1rem 1rem 3.5rem;
  border-left: 4px solid var(--md-accent-fg-color);
  background: rgba(0, 188, 212, 0.08);
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.sp-callout::before {
  content: "ℹ️";
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-size: 1.5rem;
  line-height: 1;
}

/* Callout title */
.sp-callout__title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--md-accent-fg-color);
}

/* Callout content */
.sp-callout p:last-child {
  margin-bottom: 0;
}

/* Info callout (default) */
.sp-callout--info {
  border-left-color: #2196f3;
  background: rgba(33, 150, 243, 0.08);
}

.sp-callout--info::before {
  content: "ℹ️";
}

.sp-callout--info .sp-callout__title {
  color: #2196f3;
}

/* Tip callout */
.sp-callout--tip {
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.sp-callout--tip::before {
  content: "💡";
}

.sp-callout--tip .sp-callout__title {
  color: #4caf50;
}

/* Warning callout */
.sp-callout--warning {
  border-left-color: #ff9800;
  background: rgba(255, 152, 0, 0.08);
}

.sp-callout--warning::before {
  content: "⚠️";
}

.sp-callout--warning .sp-callout__title {
  color: #ff9800;
}

/* Danger/Error callout */
.sp-callout--danger {
  border-left-color: #f44336;
  background: rgba(244, 67, 54, 0.08);
}

.sp-callout--danger::before {
  content: "🚫";
}

.sp-callout--danger .sp-callout__title {
  color: #f44336;
}

/* Success callout */
.sp-callout--success {
  border-left-color: #4caf50;
  background: rgba(76, 175, 80, 0.08);
}

.sp-callout--success::before {
  content: "✅";
}

.sp-callout--success .sp-callout__title {
  color: #4caf50;
}

/* Example callout */
.sp-callout--example {
  border-left-color: #9c27b0;
  background: rgba(156, 39, 176, 0.08);
}

.sp-callout--example::before {
  content: "📝";
}

.sp-callout--example .sp-callout__title {
  color: #9c27b0;
}

/* ============================================
   SECTION BREAKS
   ============================================ */

/* Visual section divider */
.sp-section-break {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem 0;
  text-align: center;
}

.sp-section-break::before,
.sp-section-break::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--md-default-fg-color--lighter),
    transparent
  );
}

.sp-section-break span {
  padding: 0 1.5rem;
  font-size: 1.5rem;
  opacity: 0.6;
}

/* Simple divider */
.sp-divider {
  margin: 2rem 0;
  border: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--md-default-fg-color--lighter),
    transparent
  );
}

/* ============================================
   HIGHLIGHT BOXES
   ============================================ */

/* Highlight key information */
.sp-highlight {
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: rgba(255, 235, 59, 0.1);
  border: 1px solid rgba(255, 235, 59, 0.3);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sp-highlight__title {
  margin: 0 0 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--md-accent-fg-color);
}

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

/* Statistics or key metrics display */
.sp-stat-card {
  display: inline-block;
  padding: 1rem 1.5rem;
  margin: 0.5rem;
  background: rgba(0, 188, 212, 0.1);
  border-radius: 8px;
  text-align: center;
  min-width: 120px;
}

.sp-stat-card__value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--md-accent-fg-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.sp-stat-card__label {
  display: block;
  font-size: 0.875rem;
  color: var(--md-default-fg-color--light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================
   STEP INDICATORS
   ============================================ */

/* Numbered steps for tutorials */
.sp-steps {
  counter-reset: sp-step;
  list-style: none;
  padding-left: 0;
}

.sp-steps > li {
  position: relative;
  padding-left: 4rem;
  margin-bottom: 2rem;
  counter-increment: sp-step;
}

.sp-steps > li::before {
  content: counter(sp-step);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--md-accent-fg-color);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.25rem;
}

.sp-steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 2.5rem;
  bottom: -2rem;
  width: 2px;
  background: rgba(0, 188, 212, 0.3);
}

/* ============================================
   COMPARISON TABLES
   ============================================ */

/* Enhanced table styling for comparison */
.sp-comparison-table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sp-comparison-table thead {
  background: var(--md-accent-fg-color);
  color: white;
}

.sp-comparison-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
}

.sp-comparison-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sp-comparison-table tbody tr:hover {
  background: rgba(0, 188, 212, 0.05);
}

.sp-comparison-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Mermaid Diagram Responsive Styles */
.mermaid {
  overflow-x: auto;
  max-width: 100%;
  margin: 1rem 0;
}

/* Extra Large Diagrams - For complex diagrams that need bigger text */
.mermaid-extra-large text,
.mermaid-extra-large .nodeLabel,
.mermaid-extra-large .edgeLabel,
.mermaid-extra-large .label {
  font-size: 28px !important;
  font-weight: 500 !important;
}

.mermaid-extra-large .node rect,
.mermaid-extra-large .node circle,
.mermaid-extra-large .node ellipse,
.mermaid-extra-large .node polygon {
  stroke-width: 3px !important;
}

.mermaid-extra-large .cluster rect {
  stroke-width: 2px !important;
}

/* Responsive sizing for extra large diagrams */
@media screen and (max-width: 1199px) {
  .mermaid-extra-large text,
  .mermaid-extra-large .nodeLabel,
  .mermaid-extra-large .edgeLabel,
  .mermaid-extra-large .label {
    font-size: 24px !important;
  }
}

@media screen and (max-width: 768px) {
  .mermaid-extra-large text,
  .mermaid-extra-large .nodeLabel,
  .mermaid-extra-large .edgeLabel,
  .mermaid-extra-large .label {
    font-size: 20px !important;
  }
}

@media screen and (max-width: 480px) {
  .mermaid-extra-large text,
  .mermaid-extra-large .nodeLabel,
  .mermaid-extra-large .edgeLabel,
  .mermaid-extra-large .label {
    font-size: 18px !important;
  }
}

/* Desktop - Large text for readability */
@media screen and (min-width: 1200px) {
  .mermaid text,
  .mermaid .nodeLabel,
  .mermaid .edgeLabel {
    font-size: 18px !important;
  }

  .mermaid .node rect,
  .mermaid .node circle,
  .mermaid .node ellipse,
  .mermaid .node polygon {
    stroke-width: 2px !important;
  }
}

/* Tablet - Medium text */
@media screen and (min-width: 769px) and (max-width: 1199px) {
  .mermaid text,
  .mermaid .nodeLabel,
  .mermaid .edgeLabel {
    font-size: 16px !important;
  }

  .mermaid {
    font-size: 16px;
  }
}

/* Mobile - Smaller but still readable */
@media screen and (max-width: 768px) {
  .mermaid text,
  .mermaid .nodeLabel,
  .mermaid .edgeLabel {
    font-size: 13px !important;
  }

  .mermaid {
    font-size: 13px;
    margin: 1rem -1rem; /* Extend to edges on mobile */
    padding: 0 0.5rem;
  }

  /* Make diagrams scrollable on mobile if needed */
  .sp-callout .mermaid {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
  .mermaid text,
  .mermaid .nodeLabel,
  .mermaid .edgeLabel {
    font-size: 11px !important;
  }

  .mermaid {
    font-size: 11px;
  }

  /* Ensure diagrams don't overflow */
  .mermaid svg {
    max-width: 100%;
    height: auto;
  }
}

@media screen and (max-width: 768px) {
  .sp-callout {
    padding: 1rem 1rem 1rem 3rem;
  }

  .sp-callout::before {
    left: 0.75rem;
    font-size: 1.25rem;
  }

  .sp-steps > li {
    padding-left: 3rem;
  }

  .sp-steps > li::before {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .sp-steps > li:not(:last-child)::after {
    left: 1rem;
  }

  .sp-stat-card {
    display: block;
    margin: 0.5rem 0;
    width: 100%;
  }

  /* Homepage product cards - better button spacing */
  .grid.cards li p {
    padding-bottom: 0.5rem;
  }

  .grid.cards .md-button {
    display: block;
    margin-top: 1rem;
    text-align: center;
    width: 100%;
  }

  /* New User Resources cards - reduce min width on mobile */
  div[style*="minmax(300px"] {
    grid-template-columns: 1fr !important;
  }

  /* Reduce font size slightly for long text on mobile */
  h3 {
    font-size: 1.25rem;
  }

  /* Better text wrapping for link descriptions */
  ol li, ul li {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Reduce padding in New User Resource cards on mobile */
  div[style*="padding: 2rem"] {
    padding: 1.5rem !important;
  }
}

/* Extra small screens (phones in portrait) */
@media screen and (max-width: 480px) {
  /* Further reduce grid card padding */
  .grid.cards li {
    padding: 1rem !important;
  }

  /* Stack buttons in their own row */
  .grid.cards .md-button {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Reduce h2 size for better fit */
  h2 {
    font-size: 1.5rem;
  }

  /* Compact link text */
  a strong {
    display: inline-block;
    max-width: 100%;
  }
}

/* ============================================
   DARK MODE ADJUSTMENTS
   ============================================ */

[data-md-color-scheme="slate"] .sp-callout {
  background: rgba(0, 188, 212, 0.05);
}

[data-md-color-scheme="slate"] .sp-highlight {
  background: rgba(255, 235, 59, 0.05);
  border-color: rgba(255, 235, 59, 0.2);
}

[data-md-color-scheme="slate"] .sp-stat-card {
  background: rgba(0, 188, 212, 0.08);
}

[data-md-color-scheme="slate"] .sp-comparison-table tbody tr:hover {
  background: rgba(0, 188, 212, 0.08);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .sp-callout,
  .sp-highlight {
    border: 1px solid #ccc;
    background: #f5f5f5;
    page-break-inside: avoid;
  }

  .sp-section-break {
    page-break-after: avoid;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Ensure callouts are accessible */
.sp-callout[role="alert"],
.sp-callout[role="note"] {
  /* Screen readers will announce these properly */
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sp-comparison-table tbody tr {
    transition: none;
  }
}
