﻿/* KSM Guard Tracking System Styles */
.ksm-dashboard-container {
    display: flex;
    height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ksm-sidebar {
    width: 380px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.ksm-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ksm-header {
    background-color: white;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .ksm-header h1 {
        color: #2c3e50;
        font-size: 24px;
        margin: 0;
    }

.ksm-map-container {
    flex: 1;
    position: relative;
    height: 100%;
}

.ksm-map {
    height: 100%;
    width: 100%;
    min-height: 500px;
}

.ksm-stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.ksm-stat-card {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

    .ksm-stat-card h3 {
        font-size: 14px;
        margin-bottom: 5px;
        color: #bdc3c7;
        font-weight: normal;
    }

    .ksm-stat-card .ksm-value {
        font-size: 24px;
        font-weight: bold;
    }

.ksm-checkin-panel {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

    .ksm-checkin-panel h3 {
        margin-bottom: 15px;
        text-align: center;
        font-size: 16px;
        font-weight: 600;
    }

.ksm-checkin-controls {
    display: flex;
    gap: 10px;
}

.ksm-checkin-btn {
    flex: 1;
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

    .ksm-checkin-btn:hover {
        background-color: #27ae60;
    }

.ksm-checkout-btn {
    flex: 1;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

    .ksm-checkout-btn:hover {
        background-color: #c0392b;
    }

.ksm-guard-list {
    margin-top: 20px;
}

.ksm-guard-item {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

    .ksm-guard-item:hover {
        background-color: #3d566e;
    }

    .ksm-guard-item.ksm-active {
        background-color: #3498db;
    }

.ksm-guard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
    color: white;
}

.ksm-guard-info {
    flex: 1;
}

.ksm-guard-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.ksm-guard-status {
    font-size: 12px;
    display: flex;
    align-items: center;
}

.ksm-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.ksm-status-on-duty {
    background-color: #2ecc71;
}

.ksm-status-break {
    background-color: #f39c12;
}

.ksm-status-offline {
    background-color: #e74c3c;
}

.ksm-status-patrolling {
    background-color: #3498db;
}

.ksm-status-checked-out {
    background-color: #95a5a6;
}

.ksm-time-display {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.ksm-guard-details {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    display: none;
}

    .ksm-guard-details.ksm-active {
        display: block;
    }

.ksm-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.ksm-detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #7f8c8d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
    color: white;
    font-size: 24px;
}

.ksm-detail-info h2 {
    margin-bottom: 5px;
    color: #2c3e50;
    font-size: 20px;
}

.ksm-detail-status {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.ksm-detail-body {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.ksm-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.ksm-detail-label {
    color: #7f8c8d;
}

.ksm-detail-value {
    font-weight: bold;
    color: #2c3e50;
}

.ksm-alert-badge {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-left: 10px;
}

.ksm-shift-info {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

    .ksm-shift-info h4 {
        margin-bottom: 10px;
        color: #bdc3c7;
        font-size: 14px;
        font-weight: 600;
    }

.ksm-shift-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.ksm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

    .ksm-modal.ksm-active {
        display: flex;
    }

.ksm-modal-content {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.ksm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

    .ksm-modal-header h2 {
        color: #2c3e50;
        margin: 0;
        font-size: 24px;
    }

.ksm-close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ksm-form-group {
    margin-bottom: 15px;
}

    .ksm-form-group label {
        display: block;
        margin-bottom: 5px;
        color: #2c3e50;
        font-weight: 500;
        font-size: 14px;
    }

.ksm-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

    .ksm-form-control:focus {
        outline: none;
        border-color: #3498db;
        box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    }

.ksm-form-group textarea.ksm-form-control {
    min-height: 80px;
    resize: vertical;
}

.ksm-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.ksm-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    font-size: 14px;
}

.ksm-btn-primary {
    background-color: #3498db;
    color: white;
}

    .ksm-btn-primary:hover {
        background-color: #2980b9;
    }

.ksm-btn-secondary {
    background-color: #95a5a6;
    color: white;
}

    .ksm-btn-secondary:hover {
        background-color: #7f8c8d;
    }

.ksm-btn-success {
    background-color: #2ecc71;
    color: white;
}

    .ksm-btn-success:hover {
        background-color: #27ae60;
    }

.ksm-attendance-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 12px;
}

    .ksm-attendance-table th, .ksm-attendance-table td {
        padding: 8px;
        text-align: left;
        border-bottom: 1px solid #34495e;
    }

    .ksm-attendance-table th {
        color: #bdc3c7;
        font-weight: normal;
    }

.ksm-tab-container {
    margin-top: 20px;
}

.ksm-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #34495e;
}

.ksm-tab {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    transition: all 0.3s;
}

    .ksm-tab.ksm-active {
        border-bottom: 2px solid #3498db;
        color: #3498db;
    }

.ksm-tab-content {
    display: none;
}

    .ksm-tab-content.ksm-active {
        display: block;
    }

.ksm-management-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.ksm-management-btn {
    flex: 1;
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
    font-size: 12px;
}

    .ksm-management-btn:hover {
        background-color: #2980b9;
    }

.ksm-post-info {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

    .ksm-post-info h4 {
        margin-bottom: 10px;
        color: #bdc3c7;
        font-size: 14px;
        font-weight: 600;
    }

.ksm-post-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.ksm-assignment-item {
    background-color: #34495e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.ksm-assignment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    align-items: center;
}

.ksm-assignment-title {
    font-weight: bold;
    font-size: 14px;
}

.ksm-assignment-details {
    font-size: 12px;
}

.ksm-assignment-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.ksm-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.ksm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

/* Real-time Positions Component Styles */
.ksm-real-time-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.ksm-guard-marker-container {
    background: none !important;
    border: none !important;
}

.ksm-guard-marker {
    position: relative;
    width: 24px;
    height: 24px;
}

.ksm-guard-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    position: absolute;
    top: 2px;
    left: 2px;
}

.ksm-low-battery-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #e74c3c;
    border-radius: 50%;
    border: 1px solid white;
    animation: ksm-pulse 2s infinite;
}

@keyframes ksm-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.ksm-post-marker {
    background-color: #9b59b6;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    position: relative;
}

    .ksm-post-marker[data-priority="critical"] {
        background-color: #e74c3c;
        animation: ksm-pulse 1s infinite;
    }

    .ksm-post-marker[data-priority="high"] {
        background-color: #e67e22;
    }

    .ksm-post-marker[data-priority="medium"] {
        background-color: #f1c40f;
    }

    .ksm-post-marker[data-priority="low"] {
        background-color: #2ecc71;
    }

.ksm-battery-container {
    position: relative;
    width: 60px;
    height: 20px;
    background-color: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
}

.ksm-battery-level {
    height: 100%;
    background-color: #2ecc71;
    transition: width 0.3s ease;
}

    .ksm-battery-level[style*="width: 0%"] {
        background-color: #e74c3c;
    }

    .ksm-battery-level[style*="width: 20%"] {
        background-color: #e74c3c;
    }

    .ksm-battery-level[style*="width: 40%"] {
        background-color: #f39c12;
    }

.ksm-battery-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: bold;
    color: #2c3e50;
}

/* Map Legend Styles */
/* Map Legend Styles - UPDATED FOR SIMPLIFIED ICONS */
.ksm-map-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 12px;
    min-width: 180px;
}

.ksm-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.ksm-legend-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    font-family: Arial, sans-serif;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.ksm-legend-duty {
    background-color: #2ecc71;
}

.ksm-legend-patrol {
    background-color: #3498db;
}

.ksm-legend-break {
    background-color: #f39c12;
}

.ksm-legend-offline {
    background-color: #e74c3c;
}

.ksm-legend-checkedout {
    background-color: #95a5a6;
}

.ksm-legend-post {
    background-color: #9b59b6;
    font-size: 10px;
}

/* Battery warning indicator for legend */
.ksm-legend-battery-warning {
    position: relative;
}

    .ksm-legend-battery-warning::after {
        content: '';
        position: absolute;
        top: -3px;
        right: -3px;
        width: 8px;
        height: 8px;
        background: #e74c3c;
        border-radius: 50%;
        border: 1px solid white;
    }

/* Popup Styles */
.ksm-guard-popup, .ksm-post-popup {
    min-width: 200px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ksm-popup-status {
    margin: 8px 0;
}

.ksm-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

.ksm-status-onduty {
    background-color: #2ecc71;
}

.ksm-status-patrolling {
    background-color: #3498db;
}

.ksm-status-onbreak {
    background-color: #f39c12;
}

.ksm-status-offline, .ksm-status-checkedout {
    background-color: #95a5a6;
}

.ksm-popup-battery {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.ksm-battery-indicator {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    color: white;
}

.ksm-battery-high {
    background-color: #2ecc71;
}

.ksm-battery-medium {
    background-color: #f39c12;
}

.ksm-battery-low {
    background-color: #e74c3c;
    animation: ksm-pulse 2s infinite;
}

.ksm-coordinates-input {
    display: flex;
    gap: 10px;
}

    .ksm-coordinates-input .ksm-form-control {
        flex: 1;
    }

/* Utility classes */
.ksm-text-center {
    text-align: center;
}

.ksm-mt-10 {
    margin-top: 10px;
}

.ksm-mb-10 {
    margin-bottom: 10px;
}

.ksm-hidden {
    display: none !important;
}

/* Fallback icon styles */
.ksm-fallback-icon {
    background: none !important;
    border: none !important;
}

/* Loading overlay (optional) */
.ksm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ksm-loading-message {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    font-weight: bold;
}

/* Settings Management Styles */
.ksm-settings-list {
    max-height: 400px;
    overflow-y: auto;
}

.ksm-setting-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.ksm-setting-default {
    border-left: 4px solid #3498db;
    background: #e3f2fd;
}

.ksm-setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ksm-default-badge {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

.ksm-setting-coordinates {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 8px;
}

.ksm-setting-actions {
    display: flex;
    gap: 5px;
}

    .ksm-setting-actions .ksm-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

.ksm-coordinates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

    .ksm-coordinates-grid .ksm-form-group {
        margin-bottom: 10px;
    }

.ksm-map-debug {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ksm-debug-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
}

    .ksm-debug-content h3 {
        color: #e74c3c;
        margin-bottom: 10px;
    }
