/* ===============================
   MindMap Trigger Button
================================= */
.btn-mindmap-glow {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
    color: #fff !important;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: 0 8px 22px rgba(56, 189, 248, 0.22);
    transition: all 0.25s ease;
    animation: akpGlowPulse 2.4s ease-in-out infinite;
}

.btn-mindmap-glow:hover,
.btn-mindmap-glow:focus {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.32);
}

.btn-mindmap-glow::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(59,130,246,.30) 0%, rgba(34,211,238,.10) 45%, rgba(13,110,253,0) 75%);
    z-index: -1;
    filter: blur(8px);
    animation: akpGlowFade 2.4s ease-in-out infinite;
}

@keyframes akpGlowPulse {
    0%, 100% {
        opacity: 0.95;
        box-shadow: 0 8px 22px rgba(59, 130, 246, 0.20);
    }
    50% {
        opacity: 1;
        box-shadow: 0 10px 30px rgba(56, 189, 248, 0.40);
    }
}

@keyframes akpGlowFade {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.03);
    }
}

/* ===============================
   MindMap Modal
================================= */
.mindmap-modal .modal-dialog {
    max-width: 1600px;
    margin: 1rem auto;
}

.mindmap-modal .modal-content {
    min-height: calc(100vh - 2rem);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
    background: linear-gradient(180deg, rgba(8,13,28,.98) 0%, rgba(12,19,35,.98) 100%);
}

.mindmap-modal .modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: linear-gradient(90deg, rgba(5,10,25,.98) 0%, rgba(10,20,48,.96) 42%, rgba(6,14,34,.98) 100%);
}

.mindmap-modal .modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #f8fbff;
    line-height: 1.2;
    letter-spacing: .02em;
}

.mindmap-modal .modal-body {
    padding: 0;
    background: #060b16;
}

.mindmap-shell {
    display: flex;
    min-height: calc(100vh - 100px);
}

.mindmap-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 18%, rgba(37, 99, 235, 0.18), transparent 18%),
        radial-gradient(circle at 75% 30%, rgba(56, 189, 248, 0.12), transparent 18%),
        radial-gradient(circle at 50% 55%, rgba(96, 165, 250, 0.08), transparent 24%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 20%, transparent 52%),
        linear-gradient(135deg, #020611 0%, #071127 30%, #081a3b 58%, #030915 100%);
}

.mindmap-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(125,211,252,.95) 0 1px, transparent 1.8px);
    background-size: 42px 42px;
    opacity: .10;
    mix-blend-mode: screen;
}

#mmdGraph {
    width: 100%;
    height: calc(100vh - 100px);
    min-height: 680px;
    display: block;
}

.mmd-stage-caption {
    position: absolute;
    left: 18px;
    top: 16px;
    z-index: 10;
    pointer-events: none;
    color: rgba(255,255,255,.92);
}

.mmd-stage-caption h5 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #f8fbff;
}

.mmd-stage-caption p {
    margin: 0;
    font-size: 12px;
    color: rgba(255,255,255,.62);
    max-width: 420px;
}

.mmd-story-box {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 11;
    width: 380px;
    max-width: calc(100% - 36px);
    padding: 15px 16px;
    border-radius: 16px;
    background: rgba(10, 16, 30, 0.80);
    border: 1px solid rgba(120, 180, 255, 0.12);
    box-shadow: 0 12px 45px rgba(0,0,0,.34);
    backdrop-filter: blur(12px);
    color: #e2e8f0;
    transition: opacity .22s ease, transform .22s ease;
}

.mmd-story-box.is-hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.mmd-story-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.mmd-story-text {
    font-size: 12.5px;
    line-height: 1.65;
    color: #cbd5e1;
    margin: 0;
}

.mindmap-sidebar {
    width: 300px;
    flex: 0 0 300px;
    background: linear-gradient(180deg, rgba(10,14,24,.96) 0%, rgba(14,20,34,.96) 100%);
    border-left: 1px solid rgba(255,255,255,.06);
    padding: 14px;
    overflow-y: auto;
}

.mindmap-card {
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    padding: 12px 13px;
    background: linear-gradient(180deg, rgba(17,24,39,.86) 0%, rgba(12,18,30,.92) 100%);
    margin-bottom: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.mindmap-card h5 {
    margin: 0 0 11px;
    font-size: 14px;
    font-weight: 700;
    color: #eef6ff;
}

.mmd-empty {
    font-size: 12.5px;
    color: #91a4be;
    line-height: 1.6;
}

.mmd-node-title {
    font-size: 15px;
    font-weight: 700;
    color: #f8fbff;
    margin-bottom: 8px;
}

.mmd-meta-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #7f95b2;
    margin-top: 10px;
    margin-bottom: 4px;
}

.mmd-meta-value {
    font-size: 13px;
    color: #d9e7f5;
    word-break: break-word;
}

.mmd-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: rgba(59,130,246,.14);
    color: #8ec5ff;
    border: 1px solid rgba(96,165,250,.18);
}

.mmd-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #d5e3f2;
}

.mmd-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 14px currentColor;
}

.mmd-root { background: #7dd3fc; color: #7dd3fc; }
.mmd-main { background: #38bdf8; color: #38bdf8; }
.mmd-sub  { background: #facc15; color: #facc15; }
.mmd-leaf { background: #cbd5e1; color: #cbd5e1; }

.mmd-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.mmd-btn {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: #e6f0fa;
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 12px;
    font-weight: 600;
    transition: .2s ease;
}

.mmd-btn:hover,
.mmd-btn:focus {
    background: rgba(56,189,248,.10);
    border-color: rgba(56,189,248,.25);
    color: #9ddcff;
}

@media (max-width: 991.98px) {
    .mindmap-modal .modal-dialog {
        max-width: 100%;
        margin: 0;
    }

    .mindmap-modal .modal-content {
        min-height: 100vh;
        border-radius: 0;
    }

    .mindmap-shell {
        flex-direction: column;
        min-height: 100vh;
    }

    .mindmap-sidebar {
        width: 100%;
        flex: 0 0 auto;
        border-left: 0;
        border-top: 1px solid rgba(255,255,255,.06);
    }

    #mmdGraph {
        height: 62vh;
        min-height: 420px;
    }

    .mmd-story-box {
        width: calc(100% - 30px);
        left: 15px;
        bottom: 15px;
    }
}