﻿/* Utility Classes */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-3 {
    gap: 1rem;
}

.text-muted {
    color: #6c757d;
}

.mb-0 {
    margin-bottom: 0;
}

/* Technician Location Page Styles */

.tech-location-container {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;

}

/* Header Styles */
.location-header {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-title {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Zone Tabs */
.zone-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.zone-tab {
    background: white;
    padding: 0.33rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    white-space: nowrap;
    font-size: 0.75rem;
    user-select: none;
}

    .zone-tab:hover {
        background: #f8f9fa;
    }

    .zone-tab.active {
        background: #0d6efd;
        color: white;
        border-color: #0d6efd;
    }

/* Technician Grid */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Technician Card */
.tech-location-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

    .tech-location-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

/* Card Header */
.tech-card-header {
    padding: 1rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .tech-card-header.on-job {
        background: #ffeaa7;
        border-bottom-color: #fdcb6e;
    }

    .tech-card-header.driving {
        background: #74b9ff;
        border-bottom-color: #0984e3;
    }

    .tech-card-header.available {
        background: #55efc4;
        border-bottom-color: #00b894;
    }

.tech-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.tech-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

/* Card Body */
.tech-card-body {
    padding: 1rem;
}

.location-info {
    margin-bottom: 1rem;
}

.location-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.location-icon {
    color: #6c757d;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.job-info {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

    .job-info h6 {
        margin: 0 0 0.25rem 0;
        color: #495057;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

/* Distance Badge */
.distance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

    .distance-badge.home {
        background: #d4edda;
        color: #155724;
    }

/* Map Button */
.map-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0d6efd;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

    .map-button:hover {
        background: #0b5ed7;
        color: white;
    }

/* No Technicians Message */
.no-techs-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

/* Refresh Indicator */
.refresh-indicator {
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Loading Overlay */
.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: 1000;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-3 {
    gap: 1rem;
}

.text-muted {
    color: #6c757d;
}

.mb-0 {
    margin-bottom: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tech-location-container {
        padding: 0.5rem;
    }

    .location-header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 0.75rem;
    }

        .header-actions span {
            font-size: 0.85rem;
        }

    .btn-text {
        display: none;
    }

    .zone-tabs {
        margin-bottom: 1rem;
        /* Enable horizontal scrolling on mobile */
        scrollbar-width: thin;
        scrollbar-color: #ccc #f1f1f1;
    }

        .zone-tabs::-webkit-scrollbar {
            height: 6px;
        }

        .zone-tabs::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .zone-tabs::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 3px;
        }

    .zone-tab {
        font-size: 0.75rem;
        padding: 0.25rem 0.65rem;
    }

    .tech-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .tech-location-card {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .tech-name {
        font-size: 1rem;
    }

    .tech-card-body {
        padding: 0.75rem;
    }

    .location-row {
        font-size: 0.9rem;
    }

    .job-info {
        padding: 0.5rem;
    }

    .map-button {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }

    .refresh-indicator {
        font-size: 0.8rem;
        margin-top: 1rem;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Small Desktop */
@media (min-width: 1025px) and (max-width: 1400px) {
    .tech-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

/* Large Desktop */
@media (min-width: 1401px) {
    .tech-location-container {
        max-width: 1600px;
    }

    .tech-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}
