/* Dark Neon/Cyber Theme - Learning Version */

:root {
    --bg-dark: #0a0a0f;
    --bg-container: #12121a;
    --bg-card: #1a1a2e;
    --bg-elevated: #222236;

    --neon-cyan: #00f0ff;
    --neon-magenta: #ff00ff;
    --neon-green: #00ff88;
    --neon-orange: #ffaa00;
    --neon-purple: #a855f7;

    --text-primary: #e0e0e0;
    --text-secondary: #888899;
    --text-muted: #555566;

    --border-subtle: #2a2a3e;
    --border-glow: rgba(0, 240, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at top, #1a1a2e 0%, transparent 50%),
        radial-gradient(ellipse at bottom, #0f0f1a 0%, transparent 50%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

/* Main layout with sidebar */
.main-layout {
    display: flex;
    gap: 20px;
    max-width: 1800px;
    margin: 0 auto;
}

/* Table of Contents Sidebar */
.tour-toc {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-container);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tour-toc .tour-start-btn {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px 16px;
    font-size: 0.95rem;
    flex-shrink: 0;
}

#tocList {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.tour-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Collapsible section groups */
.toc-section-group {
    list-style: none;
    margin-bottom: 4px;
}

.toc-subsections {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.toc-section-group.expanded > .toc-subsections {
    max-height: 800px;
}

/* Advanced Topics wrapper needs more room for 4 nested section groups */
.toc-advanced-group.expanded > .toc-advanced-sections {
    max-height: 3000px;
}

.toc-expand-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    display: inline-block;
    width: 12px;
}

.toc-section-group.expanded > .toc-item > .toc-expand-icon {
    transform: rotate(90deg);
}

.tour-toc .toc-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 10px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-card);
    border: 1px solid transparent;
}

.tour-toc .toc-item:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.tour-toc .toc-item.active {
    border-color: #e0e4e8;
    background: rgba(224, 228, 232, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.25);
}

.tour-toc .toc-item.completed {
    opacity: 0.6;
}

.tour-toc .toc-item.completed .toc-number {
    background: var(--neon-green);
    color: #000;
}

.tour-toc .toc-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.tour-toc .toc-item.active .toc-number {
    background: #e0e4e8;
    color: #000;
    border-color: #e0e4e8;
}

.tour-toc .toc-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.tour-toc .toc-item.active .toc-title {
    color: #e0e4e8;
}

.tour-toc .toc-item:hover .toc-title {
    color: var(--text-primary);
}

/* Hierarchical indentation for TOC */
.tour-toc .toc-section {
    font-weight: 600;
}

.tour-toc .toc-subsection {
    padding-left: 24px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-bottom: 2px;
}

.tour-toc .toc-subsection .toc-number {
    width: 28px;
    height: 20px;
    font-size: 0.7rem;
    border-radius: 4px;
}

.tour-toc .toc-subsubsection {
    padding-left: 40px;
    padding-top: 6px;
    padding-bottom: 6px;
    margin-bottom: 2px;
}

.tour-toc .toc-subsubsection .toc-number {
    width: 32px;
    height: 18px;
    font-size: 0.65rem;
    border-radius: 4px;
}

.toc-nav {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.toc-nav-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.container {
    flex: 1;
    max-width: 1400px;
    position: relative;
    background: var(--bg-container);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow:
        0 0 40px rgba(0, 240, 255, 0.1),
        0 20px 40px rgba(0, 0, 0, 0.5);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--neon-cyan) 0%, var(--neon-magenta) 25%, var(--neon-purple) 50%, var(--neon-magenta) 75%, var(--neon-cyan) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: title-shimmer 8s ease-in-out infinite;
}

@keyframes title-shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.header-controls {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.math-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    margin-bottom: 12px;
    padding: 8px 0;
}

.math-toggle input { display: none; }

.toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.math-toggle input:checked + .toggle-slider {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neon-cyan);
}

.math-toggle input:checked + .toggle-slider::after {
    transform: translateX(16px);
    background: var(--neon-cyan);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.overview {
    max-width: 700px;
    margin: 0 auto 24px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-size: 0.92rem;
    overflow: hidden;
    transition: height 0.3s ease;
}

.tour-start-btn-inline {
    display: block;
    margin: 16px auto 0;
    padding: 12px 32px;
    font-size: 1rem;
}

.tour-hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
}

.home-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 16px;
    left: 16px;
    text-decoration: none;
    transition: filter 0.2s, transform 0.2s;
}

.home-logo img {
    width: 72px;
    height: 72px;
}

.home-logo-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
    opacity: 0.5;
}

.home-logo:hover {
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.5));
    transform: scale(1.05);
}

.home-logo:hover .home-logo-label {
    opacity: 0.8;
}

.overview.tour-active {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.08);
}

.overview p + p {
    margin-top: 10px;
}

/* Tour step content rendered inside the overview box */
.tour-step-header {
    margin-bottom: 12px;
}

.tour-step-header .tour-popup-step {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tour-step-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.tour-step-body p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.tour-step-nav {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.tour-step-nav .tour-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.tour-step-nav .tour-btn-close {
    flex: 0 0 auto;
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.tour-step-nav .tour-btn-close:hover {
    border-color: #fb7185;
    color: #fb7185;
}

.section-overview, .section-summary {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.section-overview {
    background: rgba(0, 240, 255, 0.06);
    border-left: 3px solid var(--neon-cyan);
    color: var(--text-secondary);
}

.section-summary {
    background: rgba(168, 85, 247, 0.06);
    border-left: 3px solid var(--neon-purple);
    color: var(--text-secondary);
}

.controls {
    display: none; /* Hide refresh button for learning version */
}

button {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

.legend-container {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
}

.legend-container.compact {
    padding: 10px 20px;
    margin-bottom: 15px;
}

.legend-container.compact .legend-grid {
    gap: 8px 15px;
}

.legend-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin-bottom: 15px;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.legend-icon {
    flex-shrink: 0;
}

#visualization {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    background: radial-gradient(ellipse at center, #15152a 0%, var(--bg-container) 70%);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
    #visualization {
        justify-content: flex-start;
    }
}

#visualization svg {
    display: block;
}

.tooltip {
    position: absolute;
    display: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid var(--neon-cyan);
    box-shadow:
        0 0 20px rgba(0, 240, 255, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 300px;
    line-height: 1.5;
}

.tooltip strong {
    display: block;
    margin-bottom: 4px;
    color: var(--neon-cyan);
}

.subnet-controls {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
}

.controls-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-width: 300px;
}

.control-group.display-options {
    flex: 0 0 auto;
    min-width: 200px;
}

.control-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-cyan);
}

.checkbox-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subnet-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.checkbox-item:hover {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

.checkbox-item.select-all {
    font-weight: 600;
    color: var(--text-primary);
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--neon-cyan);
}

.checkbox-item span {
    font-size: 0.95rem;
    user-select: none;
}

.checkbox-item.option-checkbox {
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-weight: 500;
}

.info {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    margin-top: 30px;
    border: 1px solid var(--border-subtle);
}

.info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--neon-cyan);
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.info p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column;
    }

    .tour-toc {
        width: 100%;
        position: static;
        max-height: none;
        padding: 16px;
    }

    #tocList {
        max-height: 40vh;
        overflow-y: auto;
    }

    .tour-toc .toc-item {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 16px;
        border-radius: 12px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    header {
        margin-bottom: 20px;
    }

    .home-logo {
        position: static;
        flex-direction: row;
        gap: 8px;
        margin-bottom: 12px;
    }

    .home-logo img {
        width: 36px;
        height: 36px;
    }

    .home-logo-label {
        font-size: 0.8rem;
    }

    .overview {
        padding: 16px;
        font-size: 0.88rem;
    }

    .controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .legend {
        justify-content: center;
    }

    button {
        width: 100%;
    }

    .tour-toc .toc-item {
        min-width: 100%;
    }

    /* Action buttons compact on mobile */
    .action-buttons {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
    }

    .action-btn {
        padding: 6px 8px;
        font-size: 0.7rem;
        flex: 1 1 auto;
        min-width: 0;
        text-align: center;
        border-width: 1px;
    }

    .action-btn.toggle-anim-btn {
        flex-basis: 100%;
    }

    /* Visualization scrolls horizontally */
    #visualization {
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
    }

    /* Vocab grid single column */
    .concepts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .info {
        padding: 16px;
        margin-top: 20px;
    }

    /* Vocab panel adjustments */
    .vocab-panel {
        height: 75vh;
    }

    .vocab-list {
        grid-template-columns: 1fr;
        padding: 12px 16px;
    }

    .vocab-panel-header {
        padding: 12px 16px;
    }

    .vocab-search-container {
        padding: 12px 16px;
    }

    /* Tour step nav buttons */
    .tour-step-nav {
        flex-wrap: wrap;
    }

    .toc-nav {
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .action-buttons {
        flex-direction: column;
        gap: 6px;
        padding: 8px;
    }

    .action-btn {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* Animation for links */
svg path {
    transition: opacity 0.2s, stroke-width 0.2s;
}

svg rect {
    transition: fill 0.2s;
}

svg text {
    fill: var(--text-primary);
}

/* Learning Version - Tour Controls */
.tour-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tour-btn:hover:not(:disabled) {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.tour-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tour-btn.primary {
    color: #000;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-green) 100%);
    border: none;
    font-weight: 700;
    text-shadow: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.tour-btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: button-ripple 3s ease-in-out infinite;
}

@keyframes button-ripple {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.tour-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 30px rgba(0, 240, 255, 0.5),
        0 0 60px rgba(0, 255, 136, 0.3);
}

/* Glossary terms - styled and interactive */
.glossary-term {
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    cursor: help;
    transition: opacity 0.2s;
}

.glossary-term:hover {
    opacity: 0.8;
}

/* Glossary tooltip */
.glossary-tooltip {
    position: absolute;
    display: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 280px;
    line-height: 1.5;
    z-index: 2000;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.glossary-tooltip strong {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

/* Tour Popup - positioned near highlighted element */
/* Legacy floating popup (no longer used — tour content renders in overview box) */
.tour-popup {
    display: none;
}

@keyframes popup-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-popup-header {
    background: var(--bg-card);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.tour-popup-step {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tour-popup-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.tour-popup-content {
    padding: 16px 20px;
}

.tour-popup-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.tour-popup-nav {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
}

.tour-popup-nav .tour-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.tour-popup-nav .tour-btn-close {
    flex: 0 0 auto;
    background: transparent;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.tour-popup-nav .tour-btn-close:hover {
    border-color: #fb7185;
    color: #fb7185;
}

.tour-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.tour-nav .step-indicator {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neon-cyan);
    min-width: 100px;
    text-align: center;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* Concepts Grid */
.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.concept {
    background: var(--bg-elevated);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.concept:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.concept strong {
    display: block;
    font-size: 1.1rem;
    color: var(--neon-cyan);
    margin-bottom: 8px;
}

.concept p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Annotation labels in SVG */
.annotation-label {
    font-size: 11px;
    fill: var(--text-secondary);
    font-weight: 500;
}

.annotation-box {
    fill: var(--bg-card);
    stroke: var(--neon-cyan);
    stroke-width: 1;
}

/* Highlight effects for tour */
.tour-highlight {
    animation: neon-pulse 1.5s ease-in-out infinite;
}

@keyframes neon-pulse {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 8px var(--neon-cyan));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 20px var(--neon-cyan));
    }
}

/* Overlay that dims the entire viz — sits between the viz and the focused elements */
.tour-dim-overlay {
    fill: #0a0a0f;
    opacity: 0.75;
    transition: opacity 0.4s;
    pointer-events: none;
}

/* Highlighted elements get pulled to a group rendered on top of the overlay */
.tour-highlight {
    animation: neon-pulse 1.5s ease-in-out infinite;
}

.glossary-hover-highlight {
    filter: drop-shadow(0 0 12px var(--neon-cyan)) brightness(1.3) !important;
    transition: filter 0.2s;
}


.tour-highlight-box rect {
    pointer-events: none;
}

#tourConnectorOverlay {
    pointer-events: none;
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-subtle);
}

/* Vocabulary Header with inline button */
.vocab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vocab-header h3 {
    margin: 0;
}

.vocab-btn-inline {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: var(--bg-elevated);
    border: 1px solid var(--neon-purple);
    color: var(--neon-purple);
}

.vocab-btn-inline:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
    background: rgba(168, 85, 247, 0.1);
    transform: none;
}

/* Vocabulary Panel - Slides up from bottom */
.vocab-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60vh;
    background: var(--bg-container);
    border-top: 2px solid var(--neon-purple);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.vocab-panel.open {
    transform: translateY(0);
}

.vocab-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

.vocab-panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--neon-purple);
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.vocab-close-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.vocab-close-btn:hover {
    border-color: #fb7185;
    color: #fb7185;
    box-shadow: none;
    transform: none;
}

.vocab-search-container {
    padding: 16px 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.vocab-search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.vocab-search-input:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.vocab-search-input::placeholder {
    color: var(--text-muted);
}

.vocab-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    align-content: start;
}

.vocab-item {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.vocab-item:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.vocab-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.vocab-item-symbol {
    font-weight: 700;
    font-size: 1.1rem;
}

.vocab-item-term {
    font-weight: 600;
    font-size: 1rem;
}

.vocab-item-definition {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.vocab-item.hidden {
    display: none;
}

/* Action Buttons for Staking/Unstaking */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-container);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    margin: 0 auto 20px;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow: hidden;
}

.action-btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.action-btn.stake-btn {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.4);
}

.action-btn.stake-btn:hover {
    background: rgba(255, 215, 0, 0.25);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.action-btn.unstake-btn {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.4);
}

.action-btn.unstake-btn:hover {
    background: rgba(255, 107, 107, 0.25);
    border-color: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
}

.action-btn.toggle-anim-btn {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    border-color: rgba(0, 240, 255, 0.4);
}

.action-btn.toggle-anim-btn:hover {
    background: rgba(0, 240, 255, 0.25);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.action-btn.toggle-anim-btn.paused {
    background: rgba(255, 170, 0, 0.15);
    color: var(--neon-orange);
    border-color: rgba(255, 170, 0, 0.4);
}

.action-btn.toggle-anim-btn.paused:hover {
    background: rgba(255, 170, 0, 0.25);
    border-color: var(--neon-orange);
    box-shadow: 0 0 15px rgba(255, 170, 0, 0.3);
}

.action-btn:active {
    transform: scale(0.97);
}

/* Token halo effect for highlighted animations */
.token-halo {
    filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 12px currentColor);
}
