/* =========================================================
   BASE.CSS - Estilos Base
   Projeto: MPPE Caatinga Resiste 2026
========================================================= */

/* ===== MAPA ===== */
#map {
    width: 100vw;
    height: 100vh;
    min-height: 500px;
    z-index: var(--z-map);
}

/* ===== IMPORTAÇÃO DE FONTES ===== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Source+Sans+Pro:wght@400;600&display=swap');

/* ===== TOOLTIP LEAFLET NATIVO ===== */
.leaflet-tooltip {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    z-index: var(--z-tooltip);
    max-width: min(320px, 85vw);
    word-wrap: break-word;
}

.leaflet-tooltip b {
    font-weight: 600;
}

/* ===== CONTROLE DE ESCALA ===== */
.leaflet-control-scale {
    background: rgba(255, 255, 255, 0.85);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    font-size: var(--font-size-xs);
    box-shadow: var(--shadow-sm);
}

/* ===== CONTROLE DE CAMADAS BASE ===== */
.leaflet-control-layers {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.leaflet-control-layers-toggle {
    background-color: var(--color-primary);
}

.leaflet-control-layers-expanded {
    padding: var(--spacing-sm);
}

/* ===== SPINNER LOADING ===== */
.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-count {
    background: var(--color-primary);
    color: var(--text-light);
}

.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #ed6c02; }
.badge-error { background: #ffebee; color: #c62828; }
.badge-info { background: #e3f2fd; color: #1565c0; }

/* ===== ESTADOS DE LOADING ===== */
.loading-indicator {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
    gap: var(--spacing-md);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-lg);
    color: var(--text-muted);
    font-style: italic;
}

/* ===== CONTAINERS GENÉRICOS ===== */
.info-box {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin: var(--spacing-sm) 0;
}

.info-box-primary {
    background: #e8f5e9;
    border-left: 4px solid var(--color-primary);
}

.info-box-warning {
    background: #fff3e0;
    border-left: 4px solid var(--color-warning);
}

.info-box-error {
    background: #ffebee;
    border-left: 4px solid var(--color-error);
}

/* ===== SCROLLBAR CUSTOMIZADA ===== */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--border-dark) var(--bg-tertiary);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}