@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #0a0a0a;
    color: #00ff00;
    overflow: hidden;
    height: 100vh;
}

/* 색상 변수 */
:root {
    --neon-green: #00ff00;
    --neon-green-bright: #00ff88;
    --neon-blue: #00d4ff;
    --neon-magenta: #ff00ff;
    --neon-cyan: #00ffff;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #00ff00;
    z-index: 10;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px var(--neon-green), 0 0 20px var(--neon-green);
    font-weight: 700;
}

#chapter-title {
    font-size: 18px;
    color: var(--neon-blue);
    margin-bottom: 15px;
    text-shadow: 0 0 8px var(--neon-blue), 0 0 16px var(--neon-blue);
    font-weight: 700;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow: 0 0 8px var(--neon-blue), 0 0 16px var(--neon-blue);
    }
    100% {
        text-shadow: 0 0 12px var(--neon-blue), 0 0 24px var(--neon-blue), 0 0 32px var(--neon-blue);
    }
}

.chapter-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 5px;
}

.chapter-controls button {
    background: #0a0a0a;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-size: 20px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    min-width: 50px;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    text-shadow: 0 0 5px var(--neon-green);
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.chapter-controls button:hover:not(:disabled) {
    background: var(--neon-green);
    color: #0a0a0a;
    box-shadow: 0 0 20px var(--neon-green), 0 0 30px var(--neon-green);
    transform: scale(1.1);
}

.chapter-controls button:active:not(:disabled) {
    transform: scale(0.95);
    box-shadow: 0 0 30px var(--neon-green), 0 0 50px var(--neon-green), 0 0 70px var(--neon-green);
}

.chapter-controls button.button-clicked {
    animation: buttonHighlight 0.3s ease-out;
}

@keyframes buttonHighlight {
    0% {
        box-shadow: 0 0 20px var(--neon-green), 0 0 30px var(--neon-green);
    }
    50% {
        box-shadow: 0 0 40px var(--neon-green), 0 0 60px var(--neon-green), 0 0 80px var(--neon-green);
        border-color: var(--neon-cyan);
    }
    100% {
        box-shadow: 0 0 20px var(--neon-green), 0 0 30px var(--neon-green);
    }
}

.chapter-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #004400;
}

.chapter-counter {
    font-size: 16px;
    color: #00ff88;
    font-weight: bold;
    text-shadow: 0 0 5px #00ff88;
    margin: 0;
}

.instruction {
    font-size: 14px;
    color: #00ff88;
    margin-bottom: 5px;
}

.counter {
    font-size: 12px;
    color: #00ff88;
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
}

#concept-map {
    width: 100%;
    height: 100%;
}

.node {
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.node.node-visible {
    opacity: 1;
    transform: translateY(0);
}

.node-circle {
    fill: var(--neon-green);
    stroke: var(--neon-green-bright);
    stroke-width: 2;
    filter: drop-shadow(0 0 8px var(--neon-green)) drop-shadow(0 0 12px rgba(0, 255, 0, 0.5));
    transition: all 0.3s ease;
}

.node-circle:hover {
    fill: var(--neon-green-bright);
    stroke-width: 3;
    filter: drop-shadow(0 0 15px var(--neon-green)) drop-shadow(0 0 25px rgba(0, 255, 0, 0.8)) drop-shadow(0 0 35px rgba(0, 255, 0, 0.6));
}

/* 루트 노드 스타일 */
.node.root-node .node-circle {
    fill: var(--neon-magenta);
    stroke: var(--neon-cyan);
    filter: drop-shadow(0 0 12px var(--neon-magenta)) drop-shadow(0 0 20px rgba(255, 0, 255, 0.6));
}

.node.root-node .node-circle:hover {
    fill: var(--neon-cyan);
    stroke-width: 3.5;
    filter: drop-shadow(0 0 20px var(--neon-magenta)) drop-shadow(0 0 35px rgba(255, 0, 255, 0.9)) drop-shadow(0 0 45px rgba(255, 0, 255, 0.7));
}

.node.root-node .node-text {
    font-size: 14px;
    fill: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-magenta);
}

.node-text {
    fill: #ffffff;
    font-size: 12px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
    text-shadow: 0 0 5px #000, 0 0 10px rgba(0, 0, 0, 0.8);
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

.connection-line {
    stroke: var(--neon-green);
    stroke-width: 2.5;
    fill: none;
    opacity: 0;
    filter: drop-shadow(0 0 4px var(--neon-green)) drop-shadow(0 0 8px rgba(0, 255, 0, 0.4));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.connection-line.line-drawing {
    animation: lineDraw 0.6s ease-out forwards;
}

.connection-line.line-visible {
    opacity: 0.8;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes lineDraw {
    0% {
        stroke-dashoffset: 1000;
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.8;
    }
}

.arrow {
    fill: var(--neon-green);
    stroke: var(--neon-green);
    filter: drop-shadow(0 0 4px var(--neon-green)) drop-shadow(0 0 8px rgba(0, 255, 0, 0.4));
    opacity: 0;
    transition: opacity 0.3s ease 0.5s;
}

.arrow.arrow-visible {
    opacity: 1;
}

.node-enter {
    animation: nodeAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes nodeAppear {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.8);
    }
    60% {
        transform: translateY(-5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 툴팁 스타일 */
.concept-tooltip {
    position: fixed;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    max-width: 300px;
    min-width: 200px;
}

.concept-tooltip.tooltip-visible {
    opacity: 1;
}

.tooltip-content {
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5), 
                0 0 30px rgba(0, 255, 0, 0.3),
                inset 0 0 10px rgba(0, 255, 0, 0.1);
    position: relative;
}

.tooltip-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(0, 255, 0, 0.9);
    filter: drop-shadow(-2px 0 4px rgba(0, 255, 0, 0.5));
}

.tooltip-title {
    color: var(--neon-green);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 0 8px var(--neon-green);
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding-bottom: 6px;
}

.tooltip-detail {
    color: var(--neon-green-bright);
    font-size: 12px;
    line-height: 1.6;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

