* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
}

.coords-display {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(26, 26, 26, 0.95);
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border: 1px solid rgba(96, 6, 171, 0.3);
    z-index: 1000;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: #a855f7;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 26, 0.95);
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: 1px solid rgba(96, 6, 171, 0.5);
    z-index: 2000;
    font-size: 16px;
    color: #a855f7;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.refresh-btn {
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: #6006ab;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: #7c3aed;
}

.refresh-btn:active {
    transform: scale(0.98);
}

.bot-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.bot-marker.connected {
    background: #10b981;
}

.bot-marker.disconnected {
    background: #ef4444;
}

.bot-popup {
    font-size: 12px;
}

.bot-popup .bot-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #e9d5ff;
}

.bot-popup .status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.bot-popup .status.connected {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.bot-popup .status.disconnected {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Leaflet popup dark theme override */
.leaflet-popup-content-wrapper {
    background: rgba(26, 26, 26, 0.95);
    color: #e9d5ff;
    border: 1px solid rgba(96, 6, 171, 0.3);
    box-shadow: 0 3px 14px rgba(0,0,0,0.6);
}

.leaflet-popup-tip {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(96, 6, 171, 0.3);
}

.leaflet-popup-close-button {
    color: #a855f7 !important;
}

.leaflet-popup-close-button:hover {
    color: #c084fc !important;
}

/* Leaflet zoom controls dark theme */
.leaflet-control-zoom a {
    background-color: rgba(26, 26, 26, 0.95);
    color: #a855f7;
    border: 1px solid rgba(96, 6, 171, 0.3);
}

.leaflet-control-zoom a:hover {
    background-color: rgba(40, 40, 40, 0.95);
    color: #c084fc;
}

.stats-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(26, 26, 26, 0.95);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border: 1px solid rgba(96, 6, 171, 0.3);
    z-index: 1000;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #e9d5ff;
    min-width: 200px;
    transition: all 0.3s ease;
}

.stats-panel.collapsed {
    min-width: auto;
    padding: 8px 12px;
}

.stats-panel.collapsed .stats-content {
    display: none;
}

.stats-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #a855f7;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
}

.stats-toggle:hover {
    color: #c084fc;
    transform: scale(1.1);
}

.stats-panel.collapsed .stats-toggle {
    position: static;
}

.stats-panel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #a855f7;
    border-bottom: 1px solid rgba(96, 6, 171, 0.3);
    padding-bottom: 6px;
}

.stats-section {
    margin-bottom: 12px;
}

.stats-section:last-child {
    margin-bottom: 0;
}

.stats-section-title {
    font-size: 11px;
    color: #a3a3a3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}

.stat-label {
    color: #c4b5fd;
}

.stat-value {
    font-weight: 600;
    color: #a855f7;
    font-family: 'Courier New', monospace;
}

.stat-value.highlight {
    color: #10b981;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(96, 6, 171, 0.2);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6006ab 0%, #a855f7 100%);
    transition: width 0.5s ease;
    border-radius: 3px;
}

.bot-list-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(96, 6, 171, 0.3);
}

.bot-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    user-select: none;
}

.bot-list-header:hover {
    color: #c084fc;
}

.bot-list-toggle {
    font-size: 10px;
    transition: transform 0.2s;
}

.bot-list-section.collapsed .bot-list-toggle {
    transform: rotate(-90deg);
}

.bot-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 6px;
}

.bot-list::-webkit-scrollbar {
    width: 6px;
}

.bot-list::-webkit-scrollbar-track {
    background: rgba(96, 6, 171, 0.1);
    border-radius: 3px;
}

.bot-list::-webkit-scrollbar-thumb {
    background: rgba(96, 6, 171, 0.4);
    border-radius: 3px;
}

.bot-list::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 6, 171, 0.6);
}

.bot-list-section.collapsed .bot-list {
    display: none;
}

.bot-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 11px;
}

.bot-list-item:hover {
    background: rgba(96, 6, 171, 0.2);
}

.bot-list-item-name {
    color: #c4b5fd;
}

.bot-list-item-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
}

.bot-list-item-status.connected {
    background: #10b981;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}

.bot-list-item-status.disconnected {
    background: #ef4444;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}
