/* ============================================================
   Kubernetes: From Zero to Production — Custom Styles
   ============================================================ */

/* Better code block readability */
code {
  font-size: 0.9em;
}

pre code {
  font-size: 0.88em;
  line-height: 1.6;
}

/* ---- Callout boxes via blockquotes ---- */
blockquote {
  border-left: 4px solid #3b82f6;
  padding: 0.5em 1em;
  margin: 1em 0;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 0 4px 4px 0;
}

/* Warning callouts */
blockquote.warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

/* Danger/break-it callouts */
blockquote.danger {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

/* Success/tip callouts */
blockquote.tip {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

/* ---- Lab exercise styling ---- */
.lab-exercise {
  border: 2px solid #10b981;
  border-radius: 8px;
  padding: 1em;
  margin: 1em 0;
  background: rgba(16, 185, 129, 0.05);
}

/* ---- Tables ---- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

th {
  background: rgba(59, 130, 246, 0.1);
  padding: 0.5em 0.75em;
  text-align: left;
  border-bottom: 2px solid #3b82f6;
}

td {
  padding: 0.45em 0.75em;
  border-bottom: 1px solid rgba(127, 127, 127, 0.2);
}

tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

/* ---- Progress / chapter meta ---- */
.chapter-meta {
  font-size: 0.85em;
  opacity: 0.7;
  margin-bottom: 1.5em;
}

/* ---- Summary / takeaway tables ---- */
.key-takeaways th {
  background: rgba(16, 185, 129, 0.12);
  border-bottom-color: #10b981;
}

/* ---- Mermaid diagram centering ---- */
.mermaid {
  text-align: center;
  margin: 1.5em auto;
  overflow-x: auto;
}

.mermaid svg {
  min-width: 500px;
  font-size: 16px !important;
  max-width: 100%;
  height: auto;
}

/* ---- details/summary (Quick Check answers) ---- */
details {
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 6px;
  padding: 0.5em 1em;
  margin: 0.5em 0;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: #3b82f6;
}

details[open] summary {
  margin-bottom: 0.5em;
}

/* ---- Horizontal rule ---- */
hr {
  border: none;
  border-top: 1px solid rgba(127, 127, 127, 0.2);
  margin: 2em 0;
}

/* ---- Section time estimate badge ---- */
.time-estimate {
  display: inline-block;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 0.1em 0.6em;
  font-size: 0.8em;
  margin-bottom: 0.5em;
}

/* ---- Interactive Diagram Zoomable Styles ---- */
.diagram-zoomable {
  position: relative;
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.diagram-zoomable:hover {
  outline: 2px dashed rgba(59, 130, 246, 0.5);
  outline-offset: 4px;
  border-radius: 6px;
}

.diagram-zoomable::after {
  content: "🔍 Expand Diagram";
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.92rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

.diagram-zoomable:hover::after {
  opacity: 1;
  transform: translateY(-2px);
}

/* ---- Fullscreen Lightbox Modal ---- */
#diagram-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#diagram-modal.diagram-modal-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.diagram-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 28, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.diagram-modal-toolbar {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 18px;
  border-radius: 30px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  color: #f8fafc;
  font-family: inherit;
}

.diagram-modal-hint {
  font-size: 0.92rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-right: 8px;
}

.diagram-modal-hint kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.diagram-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f8fafc;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.diagram-modal-btn svg {
  width: 20px;
  height: 20px;
}

.diagram-modal-btn:hover {
  background: rgba(59, 130, 246, 0.4);
  border-color: rgba(59, 130, 246, 0.6);
  color: #ffffff;
}

.diagram-modal-btn:active {
  transform: scale(0.95);
}

.diagram-modal-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 4px;
}

.diagram-modal-close {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  padding: 7px 12px;
}

.diagram-modal-close:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #ffffff;
}

.diagram-modal-body {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.diagram-modal-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  transition: transform 0.05s linear;
  width: 85vw;
  height: 78vh;
  position: relative;
}

.diagram-modal-canvas svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 85vw !important;
  max-height: 78vh !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: auto;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.5));
}

.diagram-modal-canvas img {
  max-width: 85vw !important;
  max-height: 78vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  display: block !important;
  visibility: visible !important;
  margin: auto;
}

