/* Diagram Theme - Enhanced Mermaid Styling for Classroom Projection */

/* Dark background wrapper for diagrams */
.diagram-wrapper {
  background: #0f172a;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}

/* Diagram number badge */
.diagram-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #6366f1;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* Zoom controls */
.diagram-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.diagram-controls button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.diagram-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Diagram title */
.diagram-title {
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

/* Mermaid container */
.mermaid {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  transform-origin: center center;
  transition: transform 0.3s ease;
}

/* Explanatory note below diagram */
.diagram-note {
  background: rgba(99, 102, 241, 0.1);
  border-left: 4px solid #6366f1;
  color: #cbd5e1;
  padding: 0.8rem 1rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.diagram-note i {
  color: #818cf8;
  margin-right: 8px;
}

/* Responsive diagram sizing */
@media (max-width: 768px) {
  .diagram-wrapper {
    padding: 1rem;
    border-radius: 12px;
  }
  
  .mermaid svg {
    max-width: 100%;
    height: auto;
  }
  
  .diagram-badge {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  
  .diagram-controls button {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
}

/* Print styles */
@media print {
  .diagram-wrapper {
    background: white !important;
    border: 2px solid #e2e8f0;
    break-inside: avoid;
  }
  
  .diagram-badge,
  .diagram-controls {
    display: none !important;
  }
  
  .diagram-title {
    color: #1e293b;
  }
  
  .diagram-note {
    background: #f1f5f9;
    color: #475569;
    border-left-color: #6366f1;
  }
  
  .mermaid svg {
    max-width: 100%;
  }
}

/* Fullscreen mode */
.diagram-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0f172a;
  z-index: 10004;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.diagram-fullscreen .diagram-wrapper {
  width: 90%;
  max-width: 1200px;
  height: 80vh;
  margin: 0;
}

.diagram-fullscreen .mermaid {
  height: 100%;
}

.diagram-fullscreen .mermaid svg {
  max-height: 100%;
}

/* Zoom level indicators */
.zoom-level {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #94a3b8;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Animation for diagram load */
@keyframes diagramFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.mermaid svg {
  animation: diagramFadeIn 0.4s ease-out;
}
