/* Importar Space Grotesk */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* Reset e Configurações Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================
   PALETA DE CORES
   ==========================================
   
   PRIMÁRIA:   #E03D99 (Rosa/Magenta)
   SECUNDÁRIA: #7B2CBF (Roxo)
   TERCIÁRIA:  #5A5FFF (Azul)
   FUNDO:      #001B4D (Azul Escuro)
   
   ========================================== */

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #001B4D;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-size: clamp(12px, 1.5vw, 20px);
    margin: 0;
    padding: 0;
}

/* Container Principal */
.dashboard-container {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 45px);
    width: 100vw;
    padding: 0;
    gap: clamp(8px, 1vw, 20px);
    overflow: hidden;
    box-sizing: border-box;
    align-items: stretch;
}

/* Coluna Esquerda (40%) */
.left-column {
    flex: 0 0 40% !important;
    display: flex;
    flex-direction: column;
    gap: clamp(15px, 2vh, 30px);
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    width: 40% !important;
    padding-right: 10px;
}

.left-column::-webkit-scrollbar {
    width: 6px;
}

.left-column::-webkit-scrollbar-track {
    background: rgba(90, 95, 255, 0.08);
}

.left-column::-webkit-scrollbar-thumb {
    background: rgba(90, 95, 255, 0.3);
    border-radius: 3px;
}

/* Coluna Direita (60%) */
.right-column {
    flex: 0 0 60% !important;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.5vh, 20px);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    width: 60% !important;
    padding: clamp(15px, 2vw, 25px);
}

/* Seção do Mapa */
.mapa-section {
    flex: 1;
    background: transparent;
    border-radius: 0;
    padding: clamp(10px, 1.5vw, 15px);
    backdrop-filter: none;
    border: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
}

.mapa-section h2 {
    font-size: clamp(18px, 2.5vw, 32px);
    margin-bottom: clamp(8px, 1.5vh, 16px);
    font-weight: 600;
    color: #E03D99;
}

.mapa-content-wrapper {
    flex: 0 1 auto;
    display: flex;
    gap: 0;
    min-height: 0;
    width: 100%;
    padding: 0;
    max-width: 600px;
    max-height: 600px;
}

#mapa-container {
    flex: 1;
    position: relative;
    background: rgba(90, 95, 255, 0.08);
    border-radius: clamp(12px, 1.5vw, 20px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: clamp(10px, 1.5vw, 15px);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(90, 95, 255, 0.3);
}

#mapasvg {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: auto;
    object-fit: contain;
    object-position: center;
}

#mapa-object {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

#animacoes-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Lista de Inserções Lateral - REMOVIDA */

/* Seção de Métricas - Grid 2x2 */
.metricas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(12px, 2vw, 20px);
    flex: 0 0 auto;
    padding: clamp(10px, 2vw, 20px);
    margin: 0;
}

.metrica-card {
    background: rgba(90, 95, 255, 0.08);
    border-radius: 16px;
    padding: clamp(12px, 2vw, 18px);
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(90, 95, 255, 0.3);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
}

.metrica-card:hover {
    background: rgba(90, 95, 255, 0.12);
    border-color: rgba(224, 61, 153, 0.5);
    transform: translateY(-4px);
}

.metrica-valor {
    color: #E03D99;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 42px);
    line-height: 1;
    margin-bottom: 6px;
}

.metrica-label {
    font-size: clamp(11px, 1.3vw, 14px);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    font-weight: 500;
}

/* Grid de Rankings - 2x2 */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(12px, 2vw, 20px);
    flex: 1;
    padding: clamp(10px, 2vw, 20px);
    margin: 0;
    min-height: 0;
    overflow-y: auto;
}

.rankings-grid::-webkit-scrollbar {
    width: 6px;
}

.rankings-grid::-webkit-scrollbar-track {
    background: rgba(90, 95, 255, 0.08);
}

.rankings-grid::-webkit-scrollbar-thumb {
    background: rgba(90, 95, 255, 0.3);
    border-radius: 3px;
}

.ranking-card {
    background: rgba(224, 61, 153, 0.08);
    border-radius: 16px;
    padding: clamp(12px, 2vw, 16px);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(224, 61, 153, 0.3);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vw, 12px);
    min-height: 0;
    transition: all 0.3s ease;
}

.ranking-card:hover {
    background: rgba(224, 61, 153, 0.12);
    border-color: rgba(224, 61, 153, 0.6);
    transform: translateY(-4px);
}

.ranking-titulo {
    font-size: clamp(12px, 1.5vw, 16px);
    font-weight: 600;
    color: #E03D99;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(224, 61, 153, 0.2);
}

.ranking-lista {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vw, 10px);
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ranking-lista::-webkit-scrollbar {
    width: 4px;
}

.ranking-lista::-webkit-scrollbar-thumb {
    background: rgba(90, 95, 255, 0.3);
    border-radius: 2px;
}

.ranking-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: clamp(8px, 1.2vw, 12px);
    border-left: 3px solid #5A5FFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.ranking-item-posicao {
    font-weight: 700;
    color: #E03D99;
    font-size: clamp(11px, 1.3vw, 13px);
    min-width: 24px;
}

.ranking-item-nome {
    flex: 1;
    font-size: clamp(10px, 1.2vw, 12px);
    color: rgba(255, 255, 255, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-item-valor {
    font-weight: 600;
    color: #5A5FFF;
    font-size: clamp(10px, 1.2vw, 12px);
    text-align: right;
}

/* Classes antigas de gráficos removidas */

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid #E03D99;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    max-width: 300px;
}

.tooltip.hidden {
    display: none;
}

/* News Ticker */
.news-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(90deg, #001B4D 0%, rgba(0, 27, 77, 0.95) 50%, #001B4D 100%);
    border-top: 2px solid #E03D99;
    display: flex;
    align-items: center;
    min-height: 45px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(224, 61, 153, 0.3);
    overflow: hidden;
}

.ticker-header {
    display: flex;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
    border-right: 2px solid #E03D99;
    background-color: rgba(224, 61, 153, 0.1);
}

.ticker-label {
    color: #E03D99;
    font-weight: bold;
    font-size: clamp(12px, 2vw, 18px);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    animation: tickerPulse 1.5s ease-in-out infinite;
}

@keyframes tickerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    padding: 0 10px;
    min-height: 45px;
    display: flex;
    align-items: center;
}

.ticker-scroll {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.ticker-items {
    display: flex;
    align-items: center;
    gap: 30px;
    padding-right: 30px;
    animation: scrollTicker 480s linear infinite;
    white-space: nowrap;
}

@keyframes scrollTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(123, 44, 191, 0.1);
    border-left: 3px solid #E03D99;
    color: #ffffff;
    font-size: clamp(11px, 1.8vw, 16px);
    border-radius: 4px;
    flex-shrink: 0;
}

.ticker-item:hover {
    background: rgba(123, 44, 191, 0.2);
    border-left-color: #5A5FFF;
}

.ticker-item-icon {
    width: 8px;
    height: 8px;
    background-color: #E03D99;
    border-radius: 50%;
    flex-shrink: 0;
}

.ticker-item-highlight {
    color: #E03D99;
    font-weight: bold;
}

/* Animação de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-container > * {
    animation: fadeIn 0.6s ease;
}
