/* ===== Daily Planner Timeline Styles ===== */

.dp-timeline-wrapper {
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    position: relative;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
}

.dp-timeline {
    --dp-label-w: 52px;
    position: relative;
    min-width: 100%;
    user-select: none;
}

/* Hour rows */
.dp-hour-row {
    position: absolute;
    width: 100%;
    display: flex;
    align-items: flex-start;
    pointer-events: none;
}

.dp-hour-label {
    width: 50px;
    min-width: 50px;
    padding: 2px 8px 0 4px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    z-index: 1;
}

.dp-hour-line {
    flex: 1;
    border-top: 1px solid var(--mud-palette-lines-default);
    height: 0;
}

/* Task report blocks */
.dp-block {
    position: absolute;
    border-radius: 4px;
    cursor: grab;
    overflow: hidden;
    z-index: 2;
    transition: box-shadow 0.15s;
    min-height: 20px;
    touch-action: none;
}

.dp-block:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.dp-block.dp-dragging {
    opacity: 0.8;
    cursor: grabbing;
    z-index: 10;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dp-block.dp-resizing {
    z-index: 10;
}

.dp-block-content {
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    height: calc(100% - 8px);
    overflow: hidden;
}

.dp-time-indicator {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
}

.dp-customer-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dp-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.dp-status-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    white-space: nowrap;
    line-height: 1.4;
}

.dp-address {
    font-size: 0.65rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dp-location {
    font-size: 0.65rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dp-user-name {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

.dp-note {
    font-size: 0.65rem;
    color: var(--mud-palette-text-disabled);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Resize handle */
.dp-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
}

.dp-resize-handle:hover {
    background: var(--mud-palette-action-default);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .dp-timeline {
        --dp-label-w: 38px;
    }

    .dp-hour-label {
        width: 38px;
        min-width: 38px;
        font-size: 0.65rem;
        padding: 2px 4px 0 2px;
    }

    .dp-block-content {
        padding: 3px 6px;
    }

    .dp-time-indicator {
        font-size: 0.6rem;
    }

    .dp-customer-name {
        font-size: 0.7rem;
    }
}

/* Touch-friendly adjustments */
@media (pointer: coarse) {
    .dp-resize-handle {
        height: 14px;
    }

    .dp-block {
        min-height: 44px;
    }
}
