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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: #0a0f1a;
    color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.atlas-bg {
    position: fixed;
    top: 50%;
    right: -80px;
    width: 700px;
    height: 700px;
    opacity: 0.18;
    pointer-events: none;
    z-index: 1;
    transform: translateY(-50%);
}

.map {
    flex: 1;
    position: relative;
    background: #0f1419;
    isolation: isolate;
    min-height: 0;
}

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

.sidebar {
    width: 360px;
    background: #0a0f1a;
    border-right: 1px solid #1a2537;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
}

.atlas-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 340px;
    height: 340px;
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
}

.sidebar-section {
    position: relative;
    z-index: 1;
    padding: 24px;
    border-bottom: 1px solid #1a2537;
    background: rgba(10, 15, 26, 0.45);
}

.sidebar-section:last-child {
    border-bottom: none;
    flex: 1;
    overflow-y: auto;
}

.header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header span {
    font-size: 12px;
    color: #d32f2f;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 13px;
    color: #888;
    margin-top: 8px;
    line-height: 1.4;
}

.upload-area {
    border: 2px dashed #333;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(211, 47, 47, 0.02);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(211, 47, 47, 0.05) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.upload-area:hover {
    border-color: #d32f2f;
    background: rgba(211, 47, 47, 0.08);
}

.upload-area.dragover {
    border-color: #ff5252;
    background: rgba(211, 47, 47, 0.12);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.upload-text {
    font-size: 14px;
    font-weight: 600;
    color: #d32f2f;
    position: relative;
    z-index: 1;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 12px;
    color: #666;
    position: relative;
    z-index: 1;
}

.upload-area input {
    display: none;
}

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

.filter-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
}

.filter-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.filter-btn {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: transparent;
    color: #999;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    border-color: #555;
    color: #bbb;
}

.filter-btn.active {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.stat-card {
    background: #1a2537;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid #2a3a4f;
}

.stat-number {
    font-size: 22px;
    font-weight: 700;
    color: #ff5252;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.activities-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
    margin-bottom: 12px;
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-card {
    background: #1a2537;
    border-left: 3px solid #d32f2f;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #2a3a4f;
    border-left: 3px solid #d32f2f;
}

.activity-card:hover {
    background: #212d45;
    border-color: #3a4a5f;
}

.activity-card.active {
    background: #2a1416;
    border-color: #ff5252;
    box-shadow: 0 0 0 1px #ff5252 inset;
}

.activity-name {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
}

.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: #666;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-text {
    font-size: 12px;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: transparent;
    color: #999;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover {
    border-color: #555;
    color: #bbb;
}

.btn-primary {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
}

.btn-primary:hover {
    background: #b71c1c;
    border-color: #b71c1c;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #1a2537;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid #2a3a4f;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0f1a;
}

::-webkit-scrollbar-thumb {
    background: #2a3a4f;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4a5f;
}

@media (max-width: 900px) {
    .sidebar {
        width: 320px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 55vh;
        border-right: none;
        border-bottom: 1px solid #1a2537;
    }

    .map {
        flex: 1;
        min-height: 35vh;
    }
}
