/* Custom styles to supplement Tailwind */

.gantt-container {
    /* Day width will be controlled via JS variable CSS Custom Property */
    --day-width: 40px;
    --sidebar-width: 250px;
}

/* Scrollbar styling for the chart area */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Gantt specific elements */
.gantt-column-template {
    grid-template-columns: var(--sidebar-width) repeat(auto-fill, var(--day-width));
}

.task-bar {
    position: absolute;
    height: 28px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    cursor: grab;
    transition: background-color 0.2s, box-shadow 0.2s, width 0.1s, left 0.1s;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.task-bar:active {
    cursor: grabbing;
}

.task-bar:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.task-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.dark .task-progress {
    background: rgba(255, 255, 255, 0.2);
}

.task-label-inside {
    position: relative;
    z-index: 2;
    padding: 0 8px;
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.task-resizer-left,
.task-resizer-right {
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 10;
}

.task-resizer-left {
    left: 0;
}

.task-resizer-right {
    right: 0;
}

.task-dependency-point {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid #3B82F6;
    border-radius: 50%;
    opacity: 0;
    cursor: crosshair;
    z-index: 10;
    transition: opacity 0.2s;
}

.dark .task-dependency-point {
    background: #1F2937;
}

.task-bar:hover .task-dependency-point {
    opacity: 1;
}

.task-dependency-point.left {
    left: -5px;
}

.task-dependency-point.right {
    right: -5px;
}

/* Connecting Lines */
path.dependency-line {
    fill: none;
    stroke: #9CA3AF;
    stroke-width: 2px;
    marker-end: url(#arrowhead);
    transition: stroke 0.3s;
}

.dark path.dependency-line {
    stroke: #4B5563;
}

path.dependency-line.critical {
    stroke: #EF4444;
    /* Red 500 */
    stroke-width: 3px;
    marker-end: url(#arrowhead-critical);
}

/* Milestone */
.milestone-marker {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background-color: #F59E0B;
    /* Amber 500 */
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.milestone-marker:hover {
    transform: translateY(-50%) rotate(45deg) scale(1.1);
}

.milestone-marker.critical {
    background-color: #EF4444;
}

/* Drag line overlay */
#drag-line {
    position: absolute;
    pointer-events: none;
    z-index: 50;
    stroke: #3B82F6;
    stroke-width: 2px;
    stroke-dasharray: 4;
}