﻿/* DispatchBoard.css - Professional HVAC Dispatch Board Styles */

.dispatch-container {
    padding: 1rem;
    background-color: transparent;
    min-height: 100vh;
}

/* Header Section */
.dispatch-header {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

/* Zone Summary Cards */
.zone-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.zone-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #6c757d;
}

    .zone-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.12);
    }

    .zone-card.zone-alert {
        border-left-color: #dc3545;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

.zone-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

    .zone-card-header h6 {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
    }

.zone-stats {
    font-size: 0.85rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
}

.zone-priority-bar {
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
    background: #e9ecef;
    font-size: 0.7rem;
}

/* Stats Summary */
.stats-summary-container {
    background: #ff92001e;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    height: 100%;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

    .stat-card h3, .stat-card h4 {
        margin: 0;
        font-weight: 600;
    }

    .stat-card p {
        margin: 0.25rem 0 0 0;
        color: #6c757d;
        font-size: 0.9rem;
    }

.tech-summary {
    background: #e9ecef;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

/* Zone Breakdown */
.zone-breakdown {
    max-height: 200px;
    overflow-y: auto;
}

.zone-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    margin-bottom: 0.25rem;
    border-radius: 4px;
}

    .zone-summary-row:hover {
        background: #e9ecef;
    }

.zone-name {
    font-weight: 500;
    color: #495057;
}

.zone-counts {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

    .zone-counts .badge {
        font-size: 0.75rem;
    }

.priority-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    transition: width 0.3s ease;
}

    .priority-segment.high {
        background-color: #dc3545;
    }

    .priority-segment.normal {
        background-color: #ffc107;
        color: #212529;
    }

    .priority-segment.anytime {
        background-color: #28a745;
    }

/* Critical Alerts Section */
.critical-alerts-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.critical-jobs-scroll-container {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

    .critical-jobs-scroll-container::-webkit-scrollbar {
        height: 8px;
    }

    .critical-jobs-scroll-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .critical-jobs-scroll-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

        .critical-jobs-scroll-container::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

.critical-jobs-grid {
    display: flex;
    gap: 1rem;
    min-width: fit-content;
    padding-bottom: 0.5rem;
}

.critical-job-card {
    min-width: 300px;
    max-width: 350px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    background: #fff;
}

    .critical-job-card.urgency-overdue {
        border-color: #dc3545;
        background-color: #fff5f5;
    }

    .critical-job-card.urgency-critical {
        border-color: #ffc107;
        background-color: #fffdf5;
    }

    .critical-job-card.urgency-warning {
        border-color: #17a2b8;
        background-color: #f0f9ff;
    }

.tech-assignment {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* Main Content Area */
.main-content-area {
    margin-top: 1rem;
}

/* Dispatch Grid Section */
.dispatch-grid-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.dispatch-table-container {
    overflow-x: auto;
}

.dispatch-table {
    font-size: 0.9rem;
}

    .dispatch-table th {
        background-color: #f8f9fa;
        font-weight: 600;
        border-bottom: 2px solid #dee2e6;
        white-space: nowrap;
    }

    .dispatch-table td {
        vertical-align: middle;
        padding: 0.75rem 0.5rem;
    }

.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
}

    .priority-badge.priority-high {
        background-color: #ffebee;
    }

    .priority-badge.priority-normal {
        background-color: #fff8e1;
    }

    .priority-badge.priority-anytime {
        background-color: #e8f5e9;
    }

.recommendation {
    background-color: #e8f5e9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Technician Section */
.technician-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.tech-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tech-card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    background: #fff;
    transition: all 0.2s;
}

    .tech-card:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .tech-card.tech-busy {
        border-left: 3px solid #ffc107;
    }

    .tech-card.tech-available {
        border-left: 3px solid #28a745;
    }

.tech-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

    .tech-header h6 {
        margin: 0;
        font-weight: 600;
    }

.tech-stats {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.tech-location {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.next-job {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

/* Recommendations Section */
.recommendations-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.recommendation-list-scrollable {
    max-height: 740px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

    .recommendation-list-scrollable::-webkit-scrollbar {
        width: 8px;
    }

    .recommendation-list-scrollable::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .recommendation-list-scrollable::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

        .recommendation-list-scrollable::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

.recommendation-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-card {
    border: 1px solid #28a745;
    border-radius: 6px;
    padding: 1rem;
    background: #f8fffe;
    margin-bottom: 0.75rem;
}

.reassignment-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.current-assignment, .recommended-assignment {
    flex: 1;
}

.arrow-indicator {
    padding: 0 1rem;
    color: #28a745;
    font-size: 1.5rem;
}

.savings-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Utility Classes */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

/* Modal Styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.modal-dialog {
    max-height: 90vh;
}

.modal-body dl {
    margin-bottom: 0;
}

.modal-body dt {
    font-weight: 600;
    color: #495057;
}

.modal-body dd {
    margin-bottom: 0.5rem;
    color: #212529;
}

/* Responsive Design */
@media (max-width: 768px) {
    .zone-cards-container {
        grid-template-columns: 1fr;
    }

    .critical-jobs-grid {
        grid-template-columns: 1fr;
    }

    .filter-controls {
        flex-wrap: wrap;
    }

    .dispatch-table {
        font-size: 0.8rem;
    }

        .dispatch-table td, .dispatch-table th {
            padding: 0.5rem 0.25rem;
        }

    .reassignment-details {
        flex-direction: column;
    }

    .arrow-indicator {
        transform: rotate(90deg);
        padding: 0.5rem 0;
    }
}
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}