﻿/* Vision + Heat Map visuals */
.vision-frame,
.heatmap-frame {
    width: 100%;
    height: 360px;
    object-fit: contain;
    background: #111;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.vision-loading, .heatmap-loading {
    height: 360px;
}

.vision-toolbar-btn {
    --bs-btn-padding-y: .15rem;
    --bs-btn-padding-x: .45rem;
    --bs-btn-font-size: .65rem;
}

.heatmap-stage {
    position: relative;
    width: 100%;
    height: 360px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    font-size: 11px;
}

.heatmap-goal {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    cursor: default;
    white-space: nowrap;
}

    .heatmap-goal .triangle {
        width: 0;
        height: 0;
        border-top: 7px solid transparent;
        border-bottom: 7px solid transparent;
        border-left: 14px solid #0d6efd;
        margin: 0 auto 0 auto;
        filter: drop-shadow(0 0 1px rgba(0,0,0,.3));
        position: relative;
    }

        .heatmap-goal .triangle::after {
            content: '';
            position: absolute;
            left: -16px;
            top: -4px;
            width: 0;
            height: 0;
            border-top: 4px solid transparent;
            border-bottom: 4px solid transparent;
            border-left: 6px solid #f8f9fa;
            z-index: 1;
        }

.heatmap-history-tri {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 10px solid rgba(0,128,0,1); /* final alpha overridden inline */
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 1px rgba(0,0,0,.25));
    pointer-events: none;
}

    .heatmap-history-tri::after {
        content: '';
        position: absolute;
        left: -13px;
        top: -3px;
        width: 0;
        height: 0;
        border-top: 3px solid transparent;
        border-bottom: 3px solid transparent;
        border-left: 4px solid #f8f9fa;
        z-index: 1;
    }

.heatmap-goal .label {
    background: rgba(13,110,253,0.1);
    padding: 1px 4px;
    border-radius: 3px;
    color: #0d6efd;
}

.heatmap-legend {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 10px;
    background: rgba(255,255,255,0.85);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.heatmap-overlay-svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Changed current location triangle to red */
.heatmap-current-location {
    position: absolute;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 14px solid #dc3545; /* Changed from green to red */
    filter: drop-shadow(0 0 2px rgba(0,0,0,.35));
    pointer-events: none;
}

    .heatmap-current-location::after {
        content: '';
        position: absolute;
        left: -16px;
        top: -4px;
        width: 0;
        height: 0;
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
        border-left: 6px solid #f8f9fa;
    }

.heatmap-history-toggle {
    font-size: .7rem;
    user-select: none;
}

/* Custom badge for AutoTeaching status.  Could switch to text-bg-purple in bootstrap 5.2+ */
.badge-purple {
    background-color: #6f42c1;
    color: white;
}

.pending-actions-body {
    min-height: 200px; /* Accommodates the alert + button content */
    display: flex;
}

.latest-operation-body {
    min-height: 160px; /* Accommodates the 5+ rows of operation details */
    display: flex;
    flex-direction: column;
}

/* Pending Actions Timer Alert Spacing */
.pending-actions-body .alert-warning {
    padding: 1rem 1.25rem; /* Increased from Bootstrap's default 0.75rem 1.25rem */
}

    .pending-actions-body .alert-warning .d-flex {
        gap: 1.5rem; /* Adds space between the text div and button */
    }

/* Inventory Stacker Styles - Updated for responsive height */
.inventory-container {
    position: relative; /* Important: allows absolute positioning of popup */
    display: flex;
    justify-content: center; /* Always center the stackers */
    align-items: flex-end;
    min-height: 360px; /* Changed from fixed height to min-height */
    height: auto; /* Allow height to grow as needed */
    padding: 10px;
}

.stackers-section {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
    flex: 0 0 auto; /* Prevent flex from changing stacker positioning */
}

.stacker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stacker-header {
    font-size: 13px;
    color: #4d6f8b;
    font-weight: 600;
    margin-bottom: 5px;
}

.stacker {
    border: 1px solid #99acbd;
    border-radius: 5px;
    background: #f8f9fa;
    padding: 2px;
    min-width: 60px;
    display: flex;
    flex-direction: column-reverse;
}

.inventory-slot {
    height: 24px;
    margin: 1px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .inventory-slot.empty {
        background: rgba(255, 255, 255, 0.3);
        border: 1px dashed #ccc;
        color: #666;
    }

    .inventory-slot.occupied {
        background: #28a745;
        color: white;
        border: 1px solid #1e7e34;
    }

    .inventory-slot:hover,
    .inventory-slot.selected {
        transform: scale(1.1);
        z-index: 10;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

/* Floating Slot Info Panel - positioned absolutely to overlay */
.slot-info-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1100; /* Higher than heatmap content */
    max-height: 380px;
    overflow-y: auto;
}

.slot-info-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-info-panel-content {
    padding: 16px;
}

.info-item {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
}

    .info-item:last-child {
        margin-bottom: 0;
    }

    .info-item strong {
        color: #495057;
        display: block;
        margin-bottom: 2px;
    }

    .info-item.status-empty {
        color: #6c757d;
        font-style: italic;
    }

.btn-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .btn-close:before {
        content: "×";
    }

/* Touch-friendly sizing and responsive behavior for mobile */
@media (max-width: 840px) {
    .inventory-container {
        min-height: 300px; /* Reduced min-height for mobile */
        padding: 8px;
    }

    .stackers-section {
        gap: 6px; /* Slightly smaller gap for mobile */
    }

    .inventory-slot {
        min-height: 44px; /* iOS recommends 44px minimum touch target */
        min-width: 44px;
        height: 28px; /* Slightly larger for mobile touch */
        font-size: 12px; /* Slightly larger text for mobile */
    }

    .stacker {
        min-width: 50px; /* Slightly smaller for mobile */
    }

    .slot-info-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
        z-index: 1200;
    }
}

/* Additional responsive breakpoint for very small screens */
@media (max-width: 480px) {
    .inventory-container {
        min-height: 250px;
        padding: 5px;
    }

    .stackers-section {
        gap: 4px;
        flex-wrap: wrap; /* Allow stacking vertically on very small screens if needed */
    }

    .inventory-slot {
        height: 32px;
        min-height: 48px; /* Larger touch targets for very small screens */
        min-width: 48px;
    }
}
