/**
 * Personel Konum Takibi CSS
 * Google Maps entegrasyonlu responsive tasarım
 * Mobil uygulamadaki tasarım dilini koruyan stil dosyası
 */

/* Container */
.personel-konum-container {
    padding: 0;
}

/* Google Maps Container */
.google-map-container {
    height: 500px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.map-card {
    min-height: auto;
}

/* Color Legend */
.color-legend-card {
    border: 1px solid #dee2e6;
}

.legend-item {
    font-size: 0.9rem;
}

.legend-color {
    min-width: 16px;
    min-height: 16px;
    display: inline-block;
}

.map-header {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.map-controls .btn-group .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Map Error State */
.map-error {
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px dashed #dee2e6;
}

/* Personnel List */
.personnel-list-card {
    min-height: 580px;
}

.personnel-list {
    max-height: 400px;
    overflow-y: auto;
}

.personnel-card {
    transition: all 0.3s ease;
    background: #fff;
}

.personnel-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.personnel-card.border-success {
    border-left: 4px solid #28a745 !important;
}

.personnel-card.border-secondary {
    border-left: 4px solid #6c757d !important;
}

.personnel-status .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.personnel-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Personnel Filters */
.personnel-filters .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
}

.personnel-filters .btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Location History */
.location-history {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    border-bottom: 1px solid #dee2e6 !important;
}

.history-item:last-child {
    border-bottom: none !important;
}

.history-item:hover {
    background-color: #f8f9fa;
}

/* Real-time Indicator */
.real-time-indicator {
    display: flex;
    align-items: center;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* İstatistik Kartları */
.stat-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    min-height: 120px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stat-card .stat-icon {
    opacity: 0.8;
}

/* Gradient backgrounds for stat cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

/* Google Maps Info Window Styling */
.marker-info-window {
    min-width: 250px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.marker-info-window .personnel-avatar {
    flex-shrink: 0;
}

.marker-info-window .info-details {
    margin-top: 10px;
}

.marker-info-window .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Personnel Details Modal */
.personnel-details table {
    font-size: 0.9rem;
}

.personnel-details table td {
    padding: 0.5rem;
    border-top: 1px solid #dee2e6;
}

.personnel-details table td:first-child {
    width: 40%;
    font-weight: 500;
}

/* Page Header */
.page-header {
    border: 1px solid #dee2e6;
}

.page-title {
    color: #495057;
    font-weight: 600;
}

/* Badge Styling */
.nav-badge {
    background-color: #007bff;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    min-width: 1.5rem;
    text-align: center;
}

/* Loading State */
.loading-container .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .personel-konum-container {
        padding: 0 10px;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .google-map-container {
        height: 400px;
    }

    .map-card,
    .personnel-list-card {
        min-height: auto;
    }

    .personnel-list {
        max-height: 300px;
    }

    .page-header .col-md-4 {
        text-align: center !important;
        margin-top: 1rem;
    }

    .real-time-indicator {
        justify-content: center;
    }

    .map-controls {
        margin-top: 1rem;
    }

    .personnel-card {
        margin-bottom: 0.5rem;
    }

    .personnel-filters .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .google-map-container {
        height: 350px;
    }

    .personnel-details .row {
        flex-direction: column;
    }

    .personnel-details .col-md-6:first-child {
        margin-bottom: 1.5rem;
    }

    .marker-info-window {
        min-width: 200px;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .stat-card .stat-icon i {
        font-size: 1.5rem;
    }
}

/* Custom Scrollbar for Personnel List */
.personnel-list::-webkit-scrollbar {
    width: 6px;
}

.personnel-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.personnel-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.personnel-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Location History Scrollbar */
.location-history::-webkit-scrollbar {
    width: 4px;
}

.location-history::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.location-history::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

/* Animation for Real-time Updates */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.personnel-card {
    animation: fadeIn 0.3s ease-out;
}

.history-item {
    animation: fadeIn 0.3s ease-out;
}

/* Google Maps Marker Styling */
.gm-style .gm-style-iw-c {
    padding: 8px !important;
    border-radius: 8px !important;
}

.gm-style .gm-style-iw-t::after {
    background: linear-gradient(45deg, white 50%, transparent 50%);
}

/* Print Styles */
@media print {

    .map-controls,
    .personnel-actions,
    .real-time-indicator {
        display: none !important;
    }

    .google-map-container {
        border: 2px solid #000 !important;
        height: 400px !important;
    }

    .personnel-card {
        border: 1px solid #000 !important;
        margin-bottom: 0.5rem !important;
        break-inside: avoid;
    }

    .stat-card {
        border: 1px solid #000 !important;
        color: #000 !important;
        background: white !important;
    }
}

/* Dark Mode Support (future enhancement) */
@media (prefers-color-scheme: dark) {
    .personnel-card {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .marker-info-window {
        background-color: #2d3748;
        color: #e2e8f0;
    }
}

/* Accessibility Improvements */
.personnel-card:focus,
.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .personnel-card {
        border-width: 2px;
    }

    .stat-card {
        border: 2px solid #000;
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {

    .personnel-card,
    .stat-card,
    .pulse {
        animation: none;
        transition: none;
    }
}