/**
 * Main Stylesheet
 * Core styles and layout
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 50%, #9b59b6 100%);
    color: white;
    padding: 15px 30px;
    text-align: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.main-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.main-header .header-icon {
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    height: calc(100vh - 70px);
    width: 100%;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
}

/* Buttons */
button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

button:disabled {
    background: rgba(255,255,255,0.2);
    cursor: not-allowed;
    transform: none;
}

button.primary {
    background: linear-gradient(45deg, #4facfe, #00f2fe);
}

button.success {
    background: linear-gradient(45deg, #43e97b, #38f9d7);
}

button.warning {
    background: linear-gradient(45deg, #fa709a, #fee140);
}

/* Form Elements */
select, input {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    background: rgba(255,255,255,0.9);
    color: #333;
}

/* Status Section */
.status-section {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e74c3c;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.status-dot.online {
    background: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.5);
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Control Section */
.control-section {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.control-section h3 {
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    gap: 8px;
}

.control-row label {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #4facfe;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 11px;
    color: #7f8c8d;
    text-transform: uppercase;
    font-weight: 500;
}

/* Custom Leaflet Popup */
.leaflet-popup-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    margin: 8px 0;
}

.popup-header {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-detail {
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Box */
.search-box {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 12px;
    width: 150px;
}