/* ============================================
   Atlas Mindmap Styles - Neo-Brutalist Design
   ============================================ */

.lesson-mindmap-wrapper {
    margin: 2rem 0 3rem 0;
}

.mindmap-section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.mindmap-section-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark, #0f172a);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.mindmap-section-description {
    font-size: 1rem;
    color: var(--text-light, #64748b);
    font-weight: 500;
}

.mindmap-container {
    width: 100%;
    padding: 2rem;
    background: #ffffff;
    border: 4px solid var(--dark, #0f172a);
    box-shadow: 8px 8px 0 var(--dark, #0f172a);
    margin: 2rem 0;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 400px;
}

.mindmap-wrapper {
    position: relative;
    min-width: 600px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Central Node
   ============================================ */

.mindmap-central {
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: 4px solid var(--dark, #0f172a);
    box-shadow: 6px 6px 0 var(--dark, #0f172a);
    padding: 2.5rem;
    border-radius: 0;
    min-width: 240px;
    min-height: 140px;
    text-align: center;
    color: #ffffff;
}

.mindmap-node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.mindmap-node-icon {
    font-size: 2.5rem;
    line-height: 1;
    filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.2));
}

.mindmap-node-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.mindmap-node-subtitle {
    font-size: 0.9rem;
    opacity: 0.95;
    font-weight: 500;
}

/* ============================================
   Radial Layout
   ============================================ */

.mindmap-layout-radial {
    position: relative;
    min-height: 600px;
}

.mindmap-layout-radial .mindmap-central {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.mindmap-branches {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
}

.mindmap-branch {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    transform: rotate(var(--branch-angle, 0deg));
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mindmap-connector {
    width: 150px;
    height: 4px;
    background: var(--branch-color, #3b82f6);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.mindmap-branch-node {
    transform: rotate(calc(-1 * var(--branch-angle, 0deg)));
    background: #ffffff;
    border: 4px solid var(--branch-color, #3b82f6);
    box-shadow: 5px 5px 0 var(--dark, #0f172a);
    padding: 1.75rem;
    min-width: 220px;
    max-width: 300px;
    min-height: 120px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    position: relative;
}

.mindmap-branch-node:hover {
    transform: rotate(calc(-1 * var(--branch-angle, 0deg))) translate(-3px, -3px);
    box-shadow: 8px 8px 0 var(--dark, #0f172a);
}

.mindmap-branch-node.highlighted {
    background: #fef3c7;
    transform: rotate(calc(-1 * var(--branch-angle, 0deg))) scale(1.05);
}

.mindmap-node-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark, #0f172a);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.mindmap-node-description {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

/* ============================================
   Expandable Sub-items
   ============================================ */

.mindmap-expand-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    background: var(--branch-color, #3b82f6);
    border: 3px solid var(--dark, #0f172a);
    color: #ffffff;
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.mindmap-expand-btn:hover {
    transform: scale(1.1);
}

.mindmap-expand-btn.expanded {
    background: #10b981;
}

.mindmap-subitems {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.mindmap-subitem {
    font-size: 0.85rem;
    color: #475569;
    padding: 0.4rem 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.mindmap-bullet {
    color: var(--branch-color, #3b82f6);
    font-weight: 900;
    flex-shrink: 0;
}

/* ============================================
   Vertical (Tree) Layout
   ============================================ */

.mindmap-layout-vertical {
    flex-direction: column;
    padding: 2rem;
}

.mindmap-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mindmap-tree-node {
    background: #ffffff;
    border: 4px solid #6366f1;
    box-shadow: 4px 4px 0 var(--dark, #0f172a);
    padding: 1rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.mindmap-tree-root {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    font-size: 1.2rem;
    padding: 1.5rem 2rem;
}

.mindmap-tree-root .mindmap-tree-label {
    color: #ffffff;
}

.mindmap-tree-node:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--dark, #0f172a);
}

.mindmap-tree-node-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mindmap-tree-icon {
    font-size: 1.5rem;
}

.mindmap-tree-label {
    font-weight: 700;
    color: var(--dark, #0f172a);
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.mindmap-tree-children {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative;
    flex-wrap: wrap;
    justify-content: center;
}

.mindmap-tree-branch {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.mindmap-tree-branch::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    width: 2px;
    height: 1.5rem;
    background: var(--dark, #0f172a);
}

.mindmap-tree-level-1 {
    border-color: #3b82f6;
}

.mindmap-tree-level-2 {
    border-color: #10b981;
}

.mindmap-tree-level-3 {
    border-color: #06b6d4;
}

.mindmap-tree-leaf {
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
}

/* ============================================
   Horizontal Layout
   ============================================ */

.mindmap-layout-horizontal {
    flex-direction: row;
    gap: 3rem;
    align-items: flex-start;
}

.mindmap-horizontal {
    display: flex;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.mindmap-central-column {
    flex-shrink: 0;
}

.mindmap-branches-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mindmap-h-branch {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.mindmap-h-node {
    background: #ffffff;
    border: 3px solid #e2e8f0;
    border-left: 6px solid #3b82f6;
    box-shadow: 4px 4px 0 var(--dark, #0f172a);
    padding: 1rem 1.5rem;
    min-width: 180px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.mindmap-h-node:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--dark, #0f172a);
}

.mindmap-h-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.mindmap-h-item {
    background: #f8fafc;
    border: 2px solid var(--dark, #0f172a);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.mindmap-h-item:hover {
    background: #ffffff;
    transform: translateX(4px);
}

.mindmap-h-item .mindmap-bullet {
    color: #3b82f6;
    font-weight: 900;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .mindmap-container {
        padding: 1rem;
        box-shadow: 4px 4px 0 var(--dark, #0f172a);
    }

    .mindmap-layout-radial {
        min-height: 500px;
    }

    .mindmap-connector {
        width: 100px;
    }

    .mindmap-branch-node {
        min-width: 160px;
        max-width: 220px;
        padding: 1.25rem;
        min-height: 100px;
    }

    .mindmap-node-icon {
        font-size: 2rem;
    }

    .mindmap-node-title {
        font-size: 1.2rem;
    }

    .mindmap-node-label {
        font-size: 1rem;
    }

    .mindmap-horizontal {
        flex-direction: column;
        gap: 2rem;
    }

    .mindmap-tree-children {
        flex-direction: column;
        align-items: center;
    }
}

/* ============================================
   Print Styles for PDF Export
   ============================================ */

@media print {
    .mindmap-container {
        box-shadow: none;
        border: 2px solid var(--dark, #0f172a);
        page-break-inside: avoid;
    }

    .mindmap-expand-btn {
        display: none;
    }

    .mindmap-subitems {
        display: block !important;
    }

    .mindmap-branch-node:hover {
        transform: none;
        box-shadow: 5px 5px 0 var(--dark, #0f172a);
    }
}

/* ============================================
   Animation for Initial Render
   ============================================ */

@keyframes mindmapFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mindmap-container {
    animation: mindmapFadeIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.mindmap-branch {
    animation: mindmapFadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) backwards;
}

.mindmap-branch:nth-child(1) { animation-delay: 0.1s; }
.mindmap-branch:nth-child(2) { animation-delay: 0.15s; }
.mindmap-branch:nth-child(3) { animation-delay: 0.2s; }
.mindmap-branch:nth-child(4) { animation-delay: 0.25s; }
.mindmap-branch:nth-child(5) { animation-delay: 0.3s; }
.mindmap-branch:nth-child(6) { animation-delay: 0.35s; }
.mindmap-branch:nth-child(n+7) { animation-delay: 0.4s; }
