/* AutoCAD-Style Vertical Toolbar */
:root {
    --toolbar-bg: rgba(179, 179, 179, 0.95);
    --toolbar-border: #9f9f9f;
    --tool-hover: #ccc;
    --tool-active: #FFAB00;
}



.cad-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 50px;
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--toolbar-border);
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

/* Hide scrollbar for Chrome/Safari/Opera */
.cad-toolbar::-webkit-scrollbar {
    display: none;
}

.cad-tool {
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    font-size: 1.2rem;
    position: relative;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    /* Changed from left to bottom */
}

/* body.light-mode overrides for tools removed */

.cad-tool:hover {
    background: var(--tool-hover);
    color: #000;
}

.cad-tool.active {
    border-bottom-color: var(--tool-active);
    color: var(--tool-active);
    background: rgba(255, 171, 0, 0.1);
}

/* Tooltip (Command Name) */
.cad-tool::after {
    content: attr(data-cmd);
    position: absolute;
    top: 55px;
    /* Below the tool */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Consolas', monospace;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    border: 1px solid #333;
    z-index: 1001;
}

.cad-tool:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cad-separator {
    width: 1px;
    height: 24px;
    background: var(--toolbar-border);
    margin: 0 10px;
    opacity: 0.5;
}

/* Context Menu (Right Click or Dropdown) - AutoCAD 2025 Style */
.cad-context-menu {
    position: fixed;
    /* Force position below top toolbar */
    background: #2b2b2b;
    /* Solid Dark Gray (CAD Standard) */
    border: 1px solid #444;
    /* Subtle Border */
    min-width: 220px;
    display: none;
    flex-direction: column;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    padding: 2px 0;
    /* Dense spacing */
}

.cad-context-item {
    padding: 6px 12px;
    /* Compressed padding */
    font-size: 0.75rem;
    /* ~12px font */
    color: #e0e0e0;
    cursor: pointer;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    /* Clean technical font */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid transparent;
    /* Selection indicator placeholder */
}

.cad-context-item:hover {
    background: #FFAB00;
    /* Indexo Yellow Selection */
    color: #000;
    border-left-color: #000;
}

.cad-context-item span.shortcut {
    opacity: 0.5;
    font-family: 'Consolas', monospace;
    font-size: 0.7rem;
}