#tab-map {
    width: 100%;
}

.map-layout-container {
    display: flex;
    width: 100%;
    height: calc(100vh - 120px);
    background: rgba(15, 23, 42, 0.3);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Sidebar lateral */
.map-sidebar {
    width: 320px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
}

.map-sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.map-icon-badge {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.map-title-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    margin: 0;
}

.map-title-text p {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: 2px 0 0 0;
}

/* Stats Rápidas */
.map-quick-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.mini-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
}

.mini-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mini-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.status-online {
    color: #10b981;
}

/* Seções da Sidebar */
.map-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

/* Legenda */
.distance-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot.blue { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
.dot.yellow { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

/* Ranking / Lista de Chegada */
.arrival-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.arrival-list::-webkit-scrollbar { width: 3px; }
.arrival-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.arrival-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.arrival-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    transform: translateX(5px);
}

.arrival-rank {
    width: 20px;
    height: 20px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.arrival-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.arrival-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.map-sidebar-footer {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Viewport do Mapa */
.map-viewport {
    flex: 1;
    position: relative;
    min-width: 0;
    height: 100%;
    background: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

#map-container-wrapper {
    width: 100%;
    height: 100%;
}

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

/* Loader Premium */
#map-overlay-loader {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.9), #0f172a);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.premium-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-logo {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
}

#map-overlay-loader p {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.loader-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* InfoWindow Premium */
.member-info-window {
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #1e293b;
    border-radius: 16px;
}

.member-info-window img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1024px) {
    .map-layout-container {
        flex-direction: column;
        height: auto;
    }
    .map-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .map-viewport {
        height: 500px;
    }
}
