:root {
    --root-color: #2dd4bf;
    --root-stroke: #0d9488;
    --child-color: #fbbf24;
    --child-stroke: #d97706;
    --grandchild-color: #60a5fa;
    --grandchild-stroke: #2563eb;
    --link-color: #e2e8f0;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
}

svg {
    width: 100%;
    height: 100vh;
    display: block;
    cursor: grab;
}

.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    pointer-events: none;
    display: none;
    white-space: nowrap;
    z-index: 999;
}


/* Video popup styles */
.video-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-popup.active {
    opacity: 1;
}

.popup-content {
    width: 90%;
    max-width: 900px;
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.video-popup.active .popup-content {
    transform: scale(1);
    opacity: 1;
}

.popup-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.popup-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close-popup {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.close-popup:hover {
    background-color: #e2e8f0;
    color: #ef4444;
    transform: rotate(90deg);
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-color: #000;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    z-index: 1;
}
/* Node label styles */
.node-label {
    font-size: 10px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

.node-label-bg {
    stroke: #000;
    stroke-width: 0.5;
    rx: 3;
    ry: 3;
    opacity: 0.9;
}

.mode-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background-color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
  font-family: sans-serif;
  font-size: 14px;
}

.mode-toggle select {
  padding: 4px 8px;
  font-size: 14px;
}


@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}