/* ======================================== */
/* belegungsplan.css - Belegungsplan,      */
/* test-runner, timeline drag styles       */
/* ======================================== */


.is-move-mode .bp-block--moving {
    opacity: 0.3;
    pointer-events: none !important;
}

/* Belegungsplan Drag Tooltip - Capacity Badge */
.capacity-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.capacity-badge.positive {
    background: rgba(0, 142, 102, 0.2);
    color: #006b4f;
}

.capacity-badge.negative {
    background: rgba(220, 53, 69, 0.2);
    color: #a71d2a;
}

/* ========================================
   TEST RUNNER PANEL (nur in Debug-Builds)
   ======================================== */

.test-runner-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.test-runner-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    position: relative;
    font-size: 24px;
}

.test-runner-toggle:hover {
    transform: scale(1.1);
}

.test-runner-panel.running .test-runner-toggle {
    background: var(--warning);
    color: #333;
}

.test-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
}

.test-badge.passed {
    background: var(--success);
    color: white;
}

.test-badge.failed {
    background: var(--danger);
    color: white;
}

.test-runner-panel.expanded .test-runner-toggle {
    display: none;
}

.test-runner-content {
    display: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 400px;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    flex-direction: column;
}

.test-runner-panel.expanded .test-runner-content {
    display: flex;
}

.test-runner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
}

.test-runner-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.test-runner-header .btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
}

.test-runner-suites {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #eee;
    align-items: center;
    flex-wrap: wrap;
}

.test-runner-suites label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.test-runner-suites select {
    flex: 1;
    min-width: 150px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.test-runner-suites .btn {
    padding: 6px 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.test-runner-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.test-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 12px;
}

.test-summary.passed {
    background: #e8f5e9;
}

.test-summary.failed {
    background: #ffebee;
}

.summary-icon i {
    font-size: 24px;
}

.test-summary.passed .summary-icon i {
    color: var(--success);
}

.test-summary.failed .summary-icon i {
    color: var(--danger);
}

.summary-stats {
    display: flex;
    gap: 12px;
    flex: 1;
}

.summary-stats .stat {
    font-size: 13px;
    font-weight: 500;
}

.stat.passed {
    color: var(--success);
}

.stat.failed {
    color: var(--danger);
}

.stat.skipped {
    color: var(--gray-500);
}

.summary-time {
    font-size: 12px;
    color: #666;
}

.test-steps-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.test-step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    border-radius: 4px;
    background: #f9f9f9;
}

.test-step.passed {
    background: #f1f8f1;
}

.test-step.failed {
    background: #fef2f2;
}

.test-step.running {
    background: #fff8e1;
}

.test-step.skipped {
    background: #f5f5f5;
    opacity: 0.7;
}

.step-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.test-step.passed .step-icon {
    color: var(--success);
}

.test-step.failed .step-icon {
    color: var(--danger);
}

.test-step.running .step-icon {
    color: var(--warning);
}

.test-step.skipped .step-icon {
    color: var(--gray-500);
}

.step-name {
    flex: 1;
    font-size: 13px;
}

.step-time {
    font-size: 11px;
    color: #999;
    flex-shrink: 0;
}

.step-error {
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    font-size: 12px;
    user-select: text;
}

.error-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.error-message {
    color: var(--danger);
    flex: 1;
    user-select: text;
    cursor: text;
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 12px;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.error-details {
    margin-top: 4px;
    padding: 6px;
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
    font-size: 10px;
    color: #666;
    overflow-x: auto;
    max-height: 100px;
    user-select: text;
    cursor: text;
}

.test-runner-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #999;
}

.test-runner-empty i {
    font-size: 48px;
    margin-bottom: 12px;
}

.test-runner-empty p {
    margin: 0;
    text-align: center;
    font-size: 14px;
}

.test-runner-empty p.hint {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

/* All Suites Results */
.test-summary.all-suites {
    background: #f0f4f8;
    border-left: 4px solid var(--primary);
}

.test-summary.all-suites.passed {
    border-left-color: var(--success);
}

.test-summary.all-suites.failed {
    border-left-color: var(--danger);
}

.test-summary .summary-label {
    flex: 1;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.test-suites-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.test-suite-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}

.test-suite-item.passed {
    background: rgba(0, 142, 102, 0.08);
}

.test-suite-item.failed {
    background: rgba(220, 53, 69, 0.08);
}

.test-suite-item.running {
    background: rgba(255, 193, 7, 0.15);
}

.test-suite-item.skipped {
    background: rgba(108, 117, 125, 0.08);
}

.test-suite-item .suite-icon {
    width: 18px;
    display: flex;
    justify-content: center;
}

.test-suite-item.passed .suite-icon {
    color: var(--success);
}

.test-suite-item.failed .suite-icon {
    color: var(--danger);
}

.test-suite-item.running .suite-icon {
    color: var(--warning);
}

.test-suite-item.skipped .suite-icon {
    color: #999;
}

.test-suite-item .suite-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.test-suite-item .suite-stats {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.test-suite-item .suite-expand {
    width: 20px;
    display: flex;
    justify-content: center;
    color: #999;
    transition: transform 0.2s;
}

.test-suite-item.expanded .suite-expand {
    color: #666;
}

.test-suite-item {
    cursor: pointer;
    transition: background 0.2s;
}

.test-suite-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.test-suite-item.expanded {
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.suite-steps-details {
    background: #f8f9fa;
    border-radius: 0 0 4px 4px;
    padding: 8px;
    margin-bottom: 4px;
    border: 1px solid #eee;
    border-top: none;
}

.suite-steps-details .test-step {
    padding: 4px 8px;
    font-size: 12px;
    background: transparent;
}

.suite-steps-details .test-step .step-name {
    font-size: 12px;
}

.suite-steps-details .step-error {
    margin-top: 4px;
    font-size: 11px;
}

.suite-steps-details .error-details {
    font-size: 10px;
    max-height: 100px;
}

.current-suite-steps {
    padding-top: 8px;
    border-top: 1px dashed #ddd;
    max-height: 150px;
    overflow-y: auto;
}

.current-suite-steps .test-steps-list {
    max-height: none;
}

.btn-stop {
    background: var(--danger) !important;
    color: white !important;
}

.btn-stop:hover {
    background: #c82333 !important;
}

@media (max-width: 480px) {
    .test-runner-content {
        width: calc(100vw - 40px);
        max-height: 70vh;
    }

    .test-runner-panel {
        bottom: 10px;
        right: 10px;
    }
}

/* ========================================
   Timeline Drag Ghost Element
   Needs explicit styles because Blazor scoped CSS is lost on clone
   ======================================== */
.oh-drag-ghost {
    position: fixed !important;
    pointer-events: none !important;
    z-index: 10001 !important;
    opacity: 0.9 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    border-radius: 4px !important;
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 80%, black)) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    color: white !important;
}

.oh-drag-ghost .oh-block-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    padding: 4px !important;
    width: 100% !important;
}

.oh-drag-ghost .oh-block-time {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: white !important;
}

.oh-drag-ghost .oh-resize-handle,
.oh-drag-ghost .oh-close-time,
.oh-drag-ghost .oh-close-time-vertical {
    display: none !important;
}

/* Drag tooltip - must be above ghost (10001) */
#oh-drag-tooltip {
    position: fixed;
    padding: 6px 12px;
    background: var(--gray-800);
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    pointer-events: none;
    z-index: 10005 !important;
    white-space: nowrap;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}

#oh-drag-tooltip i {
    font-size: 14px;
}

/* Body state during timeline drag */
body.timeline-dragging {
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.timeline-dragging.drag-move {
    cursor: grabbing !important;
}

body.timeline-dragging.drag-move * {
    cursor: grabbing !important;
}

body.timeline-dragging.drag-resize,
body.timeline-dragging.drag-resize-vertical {
    cursor: ew-resize !important;
}

body.timeline-dragging.drag-resize *,
body.timeline-dragging.drag-resize-vertical * {
    cursor: ew-resize !important;
}

body.timeline-dragging.drag-resize-vertical,
body.timeline-dragging.drag-resize-vertical * {
    cursor: ns-resize !important;
}

/* Close time resize */
body.timeline-dragging.drag-resize-close,
body.timeline-dragging.drag-resize-close * {
    cursor: ew-resize !important;
}
