/* MENU TOGGLE BUTTON */
#menu-toggle {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
    font-size: 20px;
    color: var(--text-secondary);
}

#menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%) scale(1.1);
}

#menu-toggle.active {
    background: rgba(0, 170, 255, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

/* DRAG AREA (Top 20px for mobile gesture) */
#drag-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 99;
    cursor: ns-resize;
}
/* TOOLBAR CONTAINER */
#toolbar {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 16px;
    border-radius: 25px;
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px var(--shadow);
}

#toolbar.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* TOOL BUTTONS */
.tool-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
    white-space: nowrap;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.tool-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    font-weight: bold;
}

/* NAVIGATION MODAL */
#nav-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.nav-content {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px var(--shadow);
}

.nav-content h3 {
    text-align: center;
    color: var(--text-primary);
    margin-top: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.nav-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    color: var(--text-primary); /* Add this */
}

.nav-item:hover {
    background: var(--bg-tertiary);
}

.nav-item.bookmarked {
    color: var(--accent);
    font-weight: bold;
}

.close-nav {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 24px;
    color: var(--text-secondary);
    line-height: 1;
    z-index: 10;
}

.close-nav:hover {
    color: var(--text-primary);
}

/* Custom scrollbar for modal */
.nav-content::-webkit-scrollbar {
    width: 8px;
}

.nav-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.nav-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.nav-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}