@import 'design-system.css';

/* ============================================
   Atlas Mindmap Styles - Elegant Design
   ============================================ */

.lesson-mindmap-wrapper {
    margin: var(--space-8) 0 var(--space-12) 0;
}

.mindmap-section-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.mindmap-section-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.mindmap-section-description {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.mindmap-container {
    width: 100%;
    padding: var(--space-8);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: var(--space-8) 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, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    padding: var(--space-8);
    border-radius: var(--radius-full);
    min-width: 200px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
}

.mindmap-node-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.mindmap-node-icon {
    font-size: var(--text-4xl);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.mindmap-node-title {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mindmap-node-subtitle {
    font-size: var(--text-sm);
    opacity: 0.9;
    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: var(--space-4);
}

.mindmap-connector {
    width: 120px;
    height: 2px;
    background: var(--border);
    transition: width var(--transition-medium);
}

.mindmap-branch-node {
    transform: rotate(calc(-1 * var(--branch-angle, 0deg)));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
    min-width: 200px;
    max-width: 280px;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.mindmap-branch-node:hover {
    transform: rotate(calc(-1 * var(--branch-angle, 0deg))) translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.mindmap-branch-node.highlighted {
    background: var(--background-alt);
    border-color: var(--accent-blue);
}

.mindmap-node-label {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.mindmap-node-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}

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

.mindmap-expand-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    border: 2px solid var(--surface);
    color: #ffffff;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

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

.mindmap-expand-btn.expanded {
    background: var(--accent-green);
}

.mindmap-subitems {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.mindmap-subitem {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: var(--space-1) 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}

.mindmap-bullet {
    color: var(--accent-blue);
    font-weight: 900;
    flex-shrink: 0;
}

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

@media (max-width: 768px) {
    .mindmap-container {
        padding: var(--space-4);
    }

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

    .mindmap-connector {
        width: 80px;
    }

    .mindmap-branch-node {
        min-width: 160px;
        padding: var(--space-4);
    }
}

/* ============================================
   Animation
   ============================================ */

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

.mindmap-container {
    animation: mindmapFadeIn 0.5s ease-out;
}