/* Reset & Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

/* Map Container */
#map {
    height: 100vh;
    width: 100%;
}

/* Status Panel */
#status {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-size: 12px;
}

#status div {
    margin-bottom: 5px;
}

#status div:last-child {
    margin-bottom: 0;
}

/* Controls Panel */
#controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    gap: 10px;
}

#controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s, opacity 0.3s;
}

#controls button:hover:not(:disabled) {
    opacity: 0.8;
}

#controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Colors */
#btn-play {
    background-color: #4CAF50;
    color: white;
}

#btn-pause {
    background-color: #FF9800;
    color: white;
}

#btn-stop {
    background-color: #f44336;
    color: white;
}

/* Generator Sidebar */
#generator-sidebar {
    position: fixed;
    left: -380px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: #f5f5f5;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1500;
    transition: left 0.3s ease;
    overflow-y: auto;
}

#generator-sidebar.open {
    left: 0;
}

#toggle-sidebar {
    position: fixed;
    left: 10px;
    top: 10px;
    width: 50px;
    height: 50px;
    background: #2593d9;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    z-index: 1600;
}

#generator-sidebar.open + * #toggle-sidebar,
#generator-sidebar.open #toggle-sidebar {
    left: 390px;
}

#toggle-sidebar:hover {
    background: #1e7bb8;
}

#sidebar-content {
    padding: 20px;
}

#sidebar-content h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
}

#sidebar-content h3 {
    margin: 15px 0 10px 0;
    color: #555;
    font-size: 16px;
    border-bottom: 2px solid #2593d9;
    padding-bottom: 5px;
}

/* Device Section */
#device-section {
    margin-bottom: 20px;
}

#device-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

#device-controls button {
    flex: 1;
    padding: 8px;
    font-size: 12px;
    background: #2593d9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#device-controls button:hover {
    background: #1e7bb8;
}

#device-list {
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
    transition: background-color 0.2s;
}

.device-item:hover {
    background: #f0f0f0;
}

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

.device-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.device-item label {
    cursor: pointer;
    font-size: 13px;
    flex: 1;
}

.device-item .device-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e0e0e0;
    color: #666;
}

.device-item .device-status.online {
    background: #4CAF50;
    color: white;
}

/* Route Section */
#route-section {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 13px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #2593d9;
}

.form-group input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

.input-with-btn {
    display: flex;
    gap: 5px;
}

.input-with-btn input {
    flex: 1;
}

.input-with-btn button {
    padding: 8px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.input-with-btn button:hover {
    background: #1976D2;
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 8px;
    transition: background-color 0.3s;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-secondary {
    background: #FF9800;
    color: white;
}

.btn-secondary:hover {
    background: #F57C00;
}

/* Generator Status */
#generator-status {
    margin-top: 15px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 12px;
    color: #666;
    min-height: 40px;
}

#generator-status.error {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

#generator-status.success {
    background: #e8f5e9;
    border-color: #4CAF50;
    color: #2e7d32;
}

.error-msg {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* Scrollbar Style */
#device-list::-webkit-scrollbar,
#generator-sidebar::-webkit-scrollbar {
    width: 8px;
}

#device-list::-webkit-scrollbar-track,
#generator-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#device-list::-webkit-scrollbar-thumb,
#generator-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#device-list::-webkit-scrollbar-thumb:hover,
#generator-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Device Animation Markers */
.device-animation-marker {
    animation: pulse 2s infinite;
}

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

