﻿/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.ksmv2-layout {
    background-color: #f5f7fa;
    color: #333;
    min-height: 100vh;
}

/* Dashboard Container */
.ksmv2-dashboard-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 70px 1fr;
    height: 100vh;
}

/* Header Styles */
.ksmv2-header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

.ksmv2-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .ksmv2-logo h1 {
        font-size: 1.5rem;
        font-weight: 600;
    }

.ksmv2-logo-icon {
    font-size: 1.8rem;
}

.ksmv2-header-controls {
    display: flex;
    gap: 15px;
}

    .ksmv2-header-controls button {
        background: rgba(255,255,255,0.2);
        border: none;
        color: white;
        padding: 8px 15px;
        border-radius: 4px;
        cursor: pointer;
        transition: background 0.3s;
        display: flex;
        align-items: center;
        gap: 5px;
    }

        .ksmv2-header-controls button:hover {
            background: rgba(255,255,255,0.3);
        }

/* Sidebar Styles */
.ksmv2-sidebar {
    background-color: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ksmv2-main-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* Map Container */
.ksmv2-map-container {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.ksmv2-map {
    height: 100%;
    width: 100%;
}

/* Stats Container */
.ksmv2-stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.ksmv2-stat-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
}

    .ksmv2-stat-card:hover {
        transform: translateY(-3px);
    }

.ksmv2-stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 5px 0;
}

.ksmv2-stat-label {
    color: #666;
    font-size: 0.85rem;
}

/* Guards List */
.ksmv2-guards-list {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

    .ksmv2-guards-list h3 {
        margin-bottom: 15px;
        color: #1a237e;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.ksmv2-guard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
}

    .ksmv2-guard-item:hover {
        background-color: #e9ecef;
    }

    .ksmv2-guard-item.ksmv2-active {
        background-color: #e3f2fd;
        border-left-color: #1a237e;
    }

.ksmv2-guard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #1a237e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
}

.ksmv2-guard-info {
    flex: 1;
}

.ksmv2-guard-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.ksmv2-guard-status {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.ksmv2-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.ksmv2-status-online {
    background-color: #4caf50;
}

.ksmv2-status-offline {
    background-color: #f44336;
}

.ksmv2-status-patrolling {
    background-color: #2196f3;
}

.ksmv2-battery-status {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.ksmv2-battery-icon {
    margin-right: 5px;
}

/* Site Info */
.ksmv2-site-info {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

    .ksmv2-site-info h3 {
        margin-bottom: 10px;
        color: #1a237e;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.ksmv2-site-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ksmv2-detail-item {
    display: flex;
    flex-direction: column;
}

.ksmv2-detail-label {
    font-size: 0.8rem;
    color: #666;
}

.ksmv2-detail-value {
    font-weight: 600;
}

.ksmv2-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.ksmv2-button {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background-color: #1a237e;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

    .ksmv2-button:hover {
        background-color: #283593;
    }

.ksmv2-button-cancel {
    background-color: #6c757d;
}

    .ksmv2-button-cancel:hover {
        background-color: #5a6268;
    }

/* Map Overlay */
.ksmv2-map-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

    .ksmv2-map-overlay h4 {
        margin-bottom: 8px;
        color: #1a237e;
    }

.ksmv2-legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.85rem;
}

.ksmv2-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Site Plan */
.ksmv2-site-plan {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 20px;
}

    .ksmv2-site-plan h3 {
        margin-bottom: 15px;
        color: #1a237e;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.ksmv2-plan-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.ksmv2-plan-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    background: #f8f9fa;
}

.ksmv2-plan-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #1a237e;
}

.ksmv2-plan-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Battery Status Colors */
.ksmv2-battery-low {
    color: #f44336;
}

.ksmv2-battery-medium {
    color: #ff9800;
}

.ksmv2-battery-high {
    color: #4caf50;
}

/* Alert Dialog */
.ksmv2-alert-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.ksmv2-alert-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

    .ksmv2-alert-content h3 {
        margin-bottom: 15px;
        color: #1a237e;
    }

    .ksmv2-alert-content p {
        margin-bottom: 20px;
        color: #666;
    }

.ksmv2-alert-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ksmv2-dashboard-container {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 768px) {
    .ksmv2-dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: 70px auto 1fr;
    }

    .ksmv2-sidebar {
        grid-row: 2;
    }

    .ksmv2-main-content {
        grid-row: 3;
    }

    .ksmv2-stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .ksmv2-alert-actions {
        flex-direction: column;
    }
}

/* Current Time Display */
.ksmv2-current-time {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

    .ksmv2-current-time span {
        font-size: 1rem;
        color: white;
    }

    .ksmv2-current-time small {
        font-size: 0.7rem;
        opacity: 0.8;
        color: white;
    }

    .ksmv2-current-time i {
        font-size: 0.9rem;
        opacity: 0.9;
    }

/* Header Controls Layout */
.ksmv2-header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Responsive Design for Header */
@media (max-width: 1024px) {
    .ksmv2-header-controls {
        gap: 10px;
    }

    .ksmv2-current-time {
        padding: 6px 10px;
    }

        .ksmv2-current-time span {
            font-size: 0.9rem;
        }
}

@media (max-width: 768px) {
    .ksmv2-header {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
        gap: 10px;
    }

    .ksmv2-header-controls {
        width: 100%;
        justify-content: space-between;
    }

    .ksmv2-current-time {
        order: -1;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .ksmv2-header-controls {
        flex-wrap: wrap;
    }

    .ksmv2-current-time {
        min-width: 120px;
    }

    .ksmv2-header-controls button {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}