/* Level Mode Path Styles */

:root {
    --level-node-size: 80px;
    --level-node-gap: 120px;
    --level-offset: 80px;
    --path-color: rgba(255, 215, 0, 0.4);
    --gold-glow: rgba(255, 215, 0, 0.6);
    --node-glow: rgba(59, 130, 246, 0.5);
}

.level-path-container {
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    padding: 100px 20px 200px;
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
}

.level-path-container.active {
    display: flex;
}

/* The path SVG */
.path-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

#pathLine {
    stroke: rgba(255, 215, 0, 0.2);
    stroke-width: 4;
    stroke-dasharray: 12, 12;
    fill: none;
    stroke-linecap: round;
    animation: flow 2s linear infinite;
}

#progressLine {
    stroke: var(--path-color);
    stroke-width: 5;
    fill: none;
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px var(--gold-glow));
    transition: all 0.5s ease;
}

/* Subtler background for the non-completed path */
@keyframes flow {
    to { stroke-dashoffset: -24; }
}

.level-node {
    width: var(--level-node-size);
    height: var(--level-node-size);
    background: rgba(13, 15, 26, 0.8);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-bottom: var(--level-node-gap);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Node position offsets (alternating side-to-side) */
.level-node:nth-child(even) { transform: translateX(var(--level-offset)); }
.level-node:nth-child(odd) { transform: translateX(calc(-1 * var(--level-offset))); }

.level-node:hover {
    transform: translateX(var(--hover-x, 0)) scale(1.1) !important;
    border-color: var(--physics-primary);
    box-shadow: 0 0 30px var(--node-glow);
}

.level-node:nth-child(even):hover { --hover-x: var(--level-offset); }
.level-node:nth-child(odd):hover { --hover-x: calc(-1 * var(--level-offset)); }

/* Status Classes */
.level-node.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #34d399;
}

.level-node.active-node {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #60a5fa;
    animation: nodePulse 2s infinite;
}

.level-node.locked {
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.6;
    cursor: not-allowed;
}

.level-node.locked svg {
    filter: grayscale(1);
}

/* Label Styling (side-by-side) */
.node-info {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 200px;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Position text on the opposite side of the node's offset */
.level-node:nth-child(even) .node-info {
    left: auto;
    right: 120%;
    text-align: right;
    align-items: flex-end;
}

.level-node:nth-child(odd) .node-info {
    left: 120%;
    text-align: left;
    align-items: flex-start;
}

.node-info h4 {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    font-family: var(--font-display);
}

.node-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
    line-height: 1.2;
}

.level-node:hover .node-info h4 {
    color: var(--physics-primary);
}

/* Status Icon Styling */
.level-node .status-icon {
    width: 32px;
    height: 32px;
    color: white;
}

/* Toggle Switch Styling */
/* Tier Headers */
.tier-header {
    width: 100%;
    text-align: center;
    padding: 40px 0 20px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.1);
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.tier-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 4px;
}

.mode-toggle-wrapper {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.mode-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 100px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-toggle-btn.active {
    background: var(--physics-primary);
    color: white;
    border-color: var(--physics-primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

@keyframes nodePulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

@media (max-width: 768px) {
    :root {
        --level-offset: 40px;
        --level-node-size: 70px;
        --level-node-gap: 100px;
    }

    .level-path-container {
        padding: 60px 10px 150px;
    }
    
    .node-info {
        width: 140px;
    }

    .node-info h4 {
        font-size: 1rem;
    }

    .node-info p {
        font-size: 0.75rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .tier-header h2 {
        font-size: 1.2rem;
    }
}

/* Grid View Completion Styles - Hidden */
.theory-card.completed-card {
    position: relative;
}

.theory-card.completed-card::after {
    display: none;
}
