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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    background: #f5f5f5;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toolbar button {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.toolbar .icon-btn {
    padding: 8px 12px;
    font-size: 20px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toolbar button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toolbar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8f9fa;
}

.toolbar button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.toolbar .separator {
    width: 1px;
    height: 30px;
    background: #dee2e6;
    margin: 0 8px;
}

.help-text {
    margin-left: auto;
    color: #666;
    font-size: 13px;
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #fafafa;
    cursor: default;
    touch-action: none; /* Disable default touch behaviors for custom handling */
}

#canvas-container.panning {
    cursor: grabbing;
}

#canvas {
    width: 100%;
    height: 100%;
}

/* Task styles */
.task {
    cursor: move;
}

.task-rect {
    fill: white;
    stroke-width: 2;
    rx: 6;
}

.task.selected .task-rect {
    stroke-width: 3;
}

.task-text {
    fill: #333;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.task-circle {
    fill: white;
    stroke: #007bff;
    stroke-width: 2;
    cursor: crosshair;
    transition: all 0.2s;
    opacity: 0;
    pointer-events: none;
}

.task:hover .task-circle.emitter {
    opacity: 1;
    pointer-events: auto;
}

.task.dragging .task-circle.emitter {
    opacity: 0 !important;
    pointer-events: none;
}

.task-circle:hover {
    fill: #007bff;
    r: 8;
}

.task.selected .task-circle {
    stroke: #0056b3;
}

/* Context menu styles */
#context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10000;
    min-width: 150px;
    padding: 4px 0;
}

.context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background 0.2s;
}

.context-menu-item:hover {
    background: #f0f0f0;
}

.context-menu-item.active {
    background: #e3f2fd;
    font-weight: 500;
}

.status-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Selection box styles */
.selection-box {
    fill: rgba(0, 123, 255, 0.1);
    stroke: #007bff;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    pointer-events: none;
}

/* Arrow styles */
.dependency-arrow {
    fill: none;
    stroke: #666;
    stroke-width: 2;
    cursor: pointer;
    transition: stroke 0.2s;
}

.dependency-arrow:hover {
    stroke: #007bff;
    stroke-width: 3;
}

.dependency-arrow.selected {
    stroke: #0056b3;
    stroke-width: 3;
}

.temp-arrow {
    fill: none;
    stroke: #999;
    stroke-width: 2;
    stroke-dasharray: 5,5;
    pointer-events: none;
}

/* Text input for editing */
.task-input {
    position: absolute;
    padding: 8px;
    border: 2px solid #007bff;
    border-radius: 4px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    resize: none;
    outline: none;
    z-index: 1000;
}
