/**
 * Drawing Tools Styles
 * Styles for modular drawing tools component
 */

/* Drawing Toolbar */
.drawing-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    border-left: 1px solid #333;
    margin-left: 8px;
}

.drawing-tool-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px;
}

.drawing-tool-btn:hover {
    background: #333;
    color: #fff;
}

.drawing-tool-btn.active {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
    border-color: rgba(33, 150, 243, 0.5);
}

.drawing-tool-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

.drawing-toolbar-separator {
    width: 1px;
    height: 16px;
    background: #333;
    margin: 0 4px;
}

/* Layer for drawings over the chart */
.drawing-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* Let clicks pass through to chart by default */
    z-index: 20;
    overflow: hidden;
}

.drawing-layer.interactive {
    pointer-events: auto; /* Capture clicks when drawing */
    cursor: crosshair;
}

/* Common Drawing Elements */
.drawing-shape {
    position: absolute;
    pointer-events: stroke;
}

.drawing-line {
    position: absolute;
    height: 1px; /* Default thickness */
    background: var(--line-color, #2962ff);
    transform-origin: 0 50%;
    pointer-events: auto;
    cursor: pointer;
}

.drawing-line:hover {
    height: 3px; /* Only visual thickness increases */
    z-index: 100;
}

.drawing-line.selected {
    height: 2px;
    box-shadow: 0 0 4px var(--line-color, #2962ff);
}

.drawing-line.dashed {
    background: none;
    border-top: 1px dashed var(--line-color, #2962ff);
    height: 1px;
}

.drawing-fill {
    position: absolute;
    background: var(--fill-color, rgba(41, 98, 255, 0.1));
    pointer-events: none;
}

/* Labels */
.drawing-label {
    position: absolute;
    font-size: 10px;
    color: var(--label-color, #2962ff);
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 4px;
    border-radius: 2px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
    transform: translateY(-50%);
}

/* Handles (Action Points) */
.drawing-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 1px solid #2962ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    pointer-events: auto;
    z-index: 110;
    display: none; /* Hidden by default unless selected */
}

.drawing-item.selected .drawing-handle {
    display: block;
}

.drawing-handle:hover {
    transform: translate(-50%, -50%) scale(1.2);
    background: #2962ff;
}

.drawing-handle.active {
    cursor: grabbing;
    background: #2962ff;
    width: 12px;
    height: 12px;
}

/* Regression Band */
.regression-band {
    position: absolute;
    border-top: 1px solid var(--band-color, rgba(255, 152, 0, 0.5));
    border-bottom: 1px solid var(--band-color, rgba(255, 152, 0, 0.5));
    background: var(--fill-color, rgba(255, 152, 0, 0.1));
    transform-origin: 0 0;
    pointer-events: auto;
    cursor: pointer;
}

.regression-band.selected {
    border-width: 2px;
    background: var(--fill-color, rgba(255, 152, 0, 0.15));
}

.regression-centerline {
    position: absolute;
    height: 2px;
    background: var(--center-color, #ff9800);
    transform-origin: 0 50%;
    pointer-events: none;
}

/* Tooltip for regression stats */
.drawing-stats {
    position: absolute;
    background: #1e222d;
    border: 1px solid #2a2e39;
    padding: 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #d1d4dc;
    pointer-events: none;
    z-index: 6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.drawing-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.drawing-stats-label {
    color: #787b86;
}
