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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    background: #0a0a0a;
    color: #ffffff;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
}

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

#control-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 400px;
    max-height: calc(100vh - 40px);
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(33, 150, 243, 0.2));
}

.panel-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4CAF50;
}

.subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.section {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section:last-child {
    border-bottom: none;
}

.section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #fff;
    font-weight: 600;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

textarea, 
input[type="text"], 
select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

textarea:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #4CAF50;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.layer-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #4CAF50;
}

.checkbox-label span {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 16px;
}

.status-icon {
    font-size: 20px;
}

.status-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.status-info.loading {
    background: rgba(33, 150, 243, 0.2);
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.status-info.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-info.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.metric-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #4CAF50;
}

.thread-details {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.thread-details div {
    margin-bottom: 8px;
}

.thread-details strong {
    color: rgba(255, 255, 255, 0.9);
}

#tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    pointer-events: none;
    font-size: 13px;
    z-index: 1001;
    display: none;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar Styling */
#control-panel::-webkit-scrollbar {
    width: 8px;
}

#control-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

#control-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #control-panel {
        width: calc(100vw - 40px);
        max-height: 50vh;
    }
    
    .metrics {
        grid-template-columns: 1fr;
    }
}
