/* ==========================================
   All-Knowing Student Component Styles
   ========================================== */

:root {
    --stage-navy: #0f172a;
    --stage-blue: #0284c7;
    --stage-sky: #38bdf8;
    --stage-yellow: #facc15;
    --stage-bg-start: #f8fafc;
    --stage-bg-end: #e0f2fe;
}

.all-knowing-stage {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--stage-bg-start) 0%, var(--stage-bg-end) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 1rem;
    overflow: hidden;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Background Soft Educational Decor */
.stage-bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(2, 132, 199, 0.12) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.25;
}

.shape-1 { width: 320px; height: 320px; background: var(--stage-sky); top: -50px; left: -50px; }
.shape-2 { width: 380px; height: 380px; background: var(--stage-yellow); bottom: -80px; right: -80px; }

/* Canvas Layer */
.connection-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* Header Display */
.stage-header {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 680px;
    margin-top: 1rem;
}

.stage-tag {
    background: #fef08a;
    color: #854d0e;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scene-caption {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 800;
    color: var(--stage-navy);
    margin: 0.6rem 0 0.2rem 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.scene-subcaption {
    color: #475569;
    font-size: 0.95rem;
    margin: 0;
}

/* Learning Stage Area */
.learning-stage {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: 62vh;
    min-height: 420px;
    margin: 1rem auto;
    z-index: 4;
}

/* Floating Knowledge Nodes */
.knowledge-node {
    position: absolute;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    z-index: 6;
}

.knowledge-node.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: gentleFloat 4s ease-in-out infinite alternate;
}

.node-icon-wrapper {
    width: 60px;
    height: 60px;
    background: #ffffff;
    border: 3px solid var(--stage-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stage-blue);
    box-shadow: 0 10px 20px rgba(2, 132, 199, 0.15);
    transition: all 0.3s ease;
}

.node-svg {
    width: 32px;
    height: 32px;
}

.node-label {
    position: absolute;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.node-badge {
    background: var(--stage-yellow);
    color: #713f12;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
}

.node-label strong {
    font-size: 0.75rem;
    color: var(--stage-navy);
    margin-top: 2px;
}

/* Node Hover & Active Glow */
.knowledge-node:hover .node-icon-wrapper,
.knowledge-node.active .node-icon-wrapper {
    transform: scale(1.25);
    background: var(--stage-blue);
    color: #ffffff;
    box-shadow: 0 0 25px rgba(2, 132, 199, 0.5);
}

.knowledge-node:hover .node-label,
.knowledge-node.active .node-label {
    opacity: 1;
}

/* Node Tooltip */
.node-tooltip {
    position: absolute;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--stage-navy);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.8rem;
    width: 180px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.knowledge-node:hover .node-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Central Student Character */
.student-character {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    transition: transform 0.5s ease;
}

.character-illustration {
    position: relative;
    animation: idleBreathing 3s ease-in-out infinite alternate;
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: #ffffff;
    color: var(--stage-navy);
    border: 3px solid var(--stage-blue);
    font-size: 0.9rem;
    font-weight: 800;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    opacity: 0;
    transition: all 0.3s ease;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 8px 0;
    border-style: solid;
    border-color: var(--stage-blue) transparent;
}

.speech-bubble.active {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Real-World Vignettes (Scene 4) */
.vignettes-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vignette-card {
    position: absolute;
    transform: translate(-50%, -50%) scale(0);
    background: #ffffff;
    border: 2px solid #cbd5e1;
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    opacity: 0;
    transition: all 0.4s ease;
}

.vignette-card.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.vignette-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--stage-navy);
}

/* Footer & Controls */
.stage-footer {
    position: relative;
    z-index: 5;
    text-align: center;
}

.tagline-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.8rem;
}

.stage-controls {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.ctrl-btn {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    color: var(--stage-navy);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    background: var(--stage-blue);
    color: white;
    border-color: var(--stage-blue);
}

/* Animations */
@keyframes idleBreathing {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

@keyframes gentleFloat {
    0% { transform: translate(-50%, -50%) translateY(0); }
    100% { transform: translate(-50%, -50%) translateY(-10px); }
}

/* Mobile & Touch Optimizations */
@media (max-width: 768px) {
    .learning-stage { height: 52vh; }
    .node-icon-wrapper { width: 48px; height: 48px; }
    .node-svg { width: 24px; height: 24px; }
    .student-character svg { width: 160px; height: 213px; }
    .node-tooltip { display: none; }
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .character-illustration, .knowledge-node.visible { animation: none !important; }
    .knowledge-node, .vignette-card { transition: opacity 0.2s ease !important; }
}