/* VanLife Trophy Security Dashboard Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow: hidden;
}

.navbar {
    border-bottom: 2px solid #007bff;
}

.navbar-brand {
    font-weight: bold;
}

.navbar-brand i {
    color: #28a745;
}

/* Sidebar Styles */
.sidebar {
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.card-header h6 {
    color: #495057;
}

/* Team List Styles */
.team-list {
    max-height: 300px;
    overflow-y: auto;
}

.team-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: between;
    align-items: center;
}

.team-item:hover {
    background-color: #f8f9fa;
}

.team-item.selected {
    background-color: #007bff;
    color: white;
    border-left: 4px solid #0056b3;
}

.team-item:last-child {
    border-bottom: none;
}

.team-info {
    flex-grow: 1;
}

.team-name {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.team-details {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.team-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-active { background-color: #28a745; }
.status-inactive { background-color: #6c757d; }
.status-warning { background-color: #ffc107; }
.status-danger { background-color: #dc3545; }

.last-update {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Ranking List Styles */
.ranking-list {
    max-height: 250px;
    overflow-y: auto;
}

.ranking-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: between;
    align-items: center;
}

.ranking-position {
    font-weight: bold;
    color: #007bff;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.ranking-position.first { color: #ffd700; }
.ranking-position.second { color: #c0c0c0; }
.ranking-position.third { color: #cd7f32; }

.ranking-team {
    flex-grow: 1;
    font-weight: 500;
}

.ranking-points {
    font-weight: bold;
    color: #28a745;
}

/* Sprints List Styles */
.sprints-list {
    max-height: 300px;
    overflow-y: auto;
}

.sprint-item {
    padding: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.sprint-item:hover {
    background-color: #f8f9fa;
}

.sprint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.sprint-name {
    font-weight: bold;
    color: #333;
}

.sprint-type {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    color: white;
}

.sprint-type.gps_point { background-color: #007bff; }
.sprint-type.gps_follow { background-color: #28a745; }
.sprint-type.roadbook { background-color: #ffc107; color: #333; }

.sprint-progress {
    margin-top: 0.5rem;
}

.sprint-progress-bar {
    background-color: #e9ecef;
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
}

.sprint-progress-fill {
    height: 100%;
    background-color: #007bff;
    transition: width 0.3s;
}

.sprint-teams-count {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Map Container */
#map-container {
    position: relative;
}

#map {
    border-right: 1px solid #dee2e6;
}

/* Map Controls Overlay */
.map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.map-controls .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Status indicators */
.connection-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.connection-status.connected {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.connection-status.disconnected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modal Styles */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Badges */
.badge {
    font-size: 0.75em;
}

.badge-priority-normal { background-color: #6c757d; }
.badge-priority-high { background-color: #fd7e14; }
.badge-priority-urgent { background-color: #dc3545; }

/* Animations */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.tracking-active .status-indicator {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        height: auto;
        border-left: none;
        border-top: 1px solid #dee2e6;
    }

    #map {
        height: 50vh !important;
    }

    .team-list, .ranking-list {
        max-height: 200px;
    }

    .card {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 768px) {
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }

    .map-controls {
        top: 5px;
        left: 5px;
        padding: 0.5rem;
    }

    .connection-status {
        top: 5px;
        right: 5px;
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .team-item, .ranking-item {
        padding: 0.5rem;
    }

    .team-details {
        font-size: 0.75rem;
    }
}

/* Custom scrollbar for lists */
.team-list::-webkit-scrollbar,
.ranking-list::-webkit-scrollbar {
    width: 6px;
}

.team-list::-webkit-scrollbar-track,
.ranking-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.team-list::-webkit-scrollbar-thumb,
.ranking-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.team-list::-webkit-scrollbar-thumb:hover,
.ranking-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Leaflet Map Markers Styles */
.team-marker-inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    position: relative;
}

.team-marker-inner i {
    font-size: 18px;
    margin-bottom: 2px;
}

.team-marker-inner .team-name {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    white-space: nowrap;
    margin-top: 4px;
}

.sprint-marker-inner {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    position: relative;
}

.sprint-marker-inner.sprint-gps_point {
    background-color: #007bff;
}

.sprint-marker-inner.sprint-gps_follow {
    background-color: #28a745;
}

.sprint-marker-inner.sprint-roadbook {
    background-color: #ffc107;
}

.sprint-marker-inner i {
    font-size: 14px;
}

.sprint-marker-inner .sprint-number {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Popup styles */
.team-popup, .sprint-popup {
    min-width: 200px;
}

.team-popup h6, .sprint-popup h6 {
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.team-popup p, .sprint-popup p {
    margin: 5px 0;
    font-size: 13px;
}

.team-popup .btn, .sprint-popup .btn {
    margin-top: 10px;
    width: 100%;
}

/* Selected team highlighting */
.team-item.selected {
    background-color: #007bff;
    color: white;
}

.team-item.selected .team-status {
    color: white;
}

.team-item.selected .status-indicator {
    border-color: white;
}