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

/* ===== RESET E BASE ===== */
html {
    font-size: 16px; /* Base para unidades em */
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
    font-size: 1rem; /* 16px base, ajusta com zoom */
}

h1, h2 {
    color: #00507a;
}

/* ===== LAYOUT PRINCIPAL ===== */
.container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0;
    height: 100vh; /* Viewport height - ajusta com zoom */
    width: 100%;
}

#map {
    flex: 2;
    height: 100%;
    border: none;
}

#filtros {
    width: 30rem; /* 480px / 16 = 30rem */
    padding: 0 1rem 1rem 1rem; /* 16px = 1rem */
    background: white;
    border: none;
    border-radius: 0;
    height: 100vh; /* Viewport height - ajusta com zoom */
    y:nter;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== FORMULÁRIO ===== */
label, select, button {
    display: block;
    width: 100%;
    margin-bottom: 0.625rem; /* 10px / 16 = 0.625rem */
    font-size: 1rem; /* 16px - ajusta com zoom */
}

select {
    padding: 0.5rem; /* 8px / 16 = 0.5rem */
    border: 1px solid #d3e3ef;
    border-radius: 0.25rem; /* 4px / 16 = 0.25rem */
    box-sizing: border-box;
}

button {
    background-color: #043b65;
    color: white;
    padding: 0.5rem; /* 8px / 16 = 0.5rem */
    border: none;
    border-radius: 0.25rem; /* 4px / 16 = 0.25rem */
    cursor: pointer;
    font-weight: bold;
    margin-top: 4rem;
}

button:hover {
    background-color: #005a9e;
}

/* ===== COMPONENTES CUSTOMIZADOS ===== */
.titulo-filtros {
    color: #454545;
    font-weight: 740;
    font-size: 1rem; /* 16px - ajusta com zoom */
    margin-bottom: 1.875rem; /* 30px / 16 = 1.875rem */
    text-transform: uppercase;
    letter-spacing: 0.03125rem; /* 0.5px / 16 = 0.03125rem */
    margin-top:7.5rem;
}

.label-custom {
    color: #489411.155;
 /* 180px / 16 = 11.25rem */    
    font-weight: 630;
    text-align: left;
    margin-bottom: 0.375rem; /* 6px / 16 = 0.375rem */
    display: block;
    font-size: 0.8125rem; /* 13px / 16 = 0.8125rem */
    width: 19.3125rem; /* 309px / 16 = 19.3125rem */
    margin-left: auto;
    margin-right: auto;
}

.select-custom {
    width: 19.3125rem; /* 309px / 16 = 19.3125rem */
    height: 2.75rem; /* 44px / 16 = 2.75rem */
    padding: 0.5rem 0.75rem; /* 8px 12px / 16 */
    font-size: 0.9375rem; /* 15px / 16 = 0.9375rem */
    border: 1px solid #ccc;
    border-radius: 0.5rem; /* 8px / 16 = 0.5rem */
    margin-bottom: 0.75rem; /* 12px / 16 = 0.75rem */
    box-sizing: border-box;
    appearance: none;
    background: url('data:image/svg+xml;charset=UTF-8,<svg fill="gray" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 0.75rem center/1rem 1rem;
    background-color: #fff;
    background-origin: content-box;
    margin-left: auto;
    margin-right: auto;
}

.btn-custom {
    background-color: #08007B;
    color: white;
    height: 3rem; /* 48px / 16 = 3rem */
    padding: 0 1rem; /* 0 16px / 16 */
    font-size: 1rem; /* 16px - ajusta com zoom */
    font-weight: bold;
    border: none;
    border-radius: 0.5rem; /* 8px / 16 = 0.5rem */
    cursor: pointer;
    width: 13.75rem; /* 220px / 16 = 13.75rem */
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s ease;
}

.btn-custom:hover {
    background-color: #393968;
}

/* ===== LOGO E HEADER ===== */
img.logo-container{
    display: block;
    margin-top: 8rem;
    margin-left: auto;
    margin-right: auto;
}

.titulo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3.75rem;
    padding-left: 0;
    padding-right: 0;
    gap: 1rem;
}

.logo-text-block {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.logo-text {
    font-size: 1.5625rem; /* 25px / 16 = 1.5625rem */
    color: #08007B;
    font-weight: bold;
    font-family: 'Segoe UI', sans-serif;
    width: 9.5rem;
}

.top-bar {
    width: 107%;
    margin-bottom: 3rem;
}
.logo-header {
    margin-left: 1.25rem; /* 20px / 16 = 1.25rem */
}

/* ===== MODO ESCURO ===== */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode #filtros {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #4a9eff;
}

body.dark-mode .titulo-filtros {
    color: #b0b0b0;
}

body.dark-mode .label-custom {
    color: #6bc04a;
}

body.dark-mode .select-custom {
    background-color: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .select-custom:focus {
    border-color: #4a9eff;
    outline: none;
}

body.dark-mode .btn-custom {
    background-color: #4a9eff;
}

body.dark-mode .btn-custom:hover {
    background-color: #6bb3ff;
}

body.dark-mode button {
    background-color: #4a9eff;
}

body.dark-mode button:hover {
    background-color: #6bb3ff;
}

body.dark-mode .logo-text {
    color: #6bb3ff;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    justify-content: center;
    align-items: center;
    text-align: left  ;
    width: 9.5rem;
}

/* ===== SWITCH TOGGLE MODO ESCURO ===== */
.switch {
    font-size: 17px;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: inline-block;
    width: 64px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #73C0FC;
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 30px;
    width: 30px;
    border-radius: 20px;
    left: 2px;
    bottom: 2px;
    z-index: 2;
    background-color: #e8e8e8;
    transition: .4s;
}

.sun svg {
    position: absolute;
    top: 6px;
    left: 36px;
    z-index: 1;
    width: 24px;
    height: 24px;
}

.moon svg {
    fill: #73C0FC;
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 1;
    width: 24px;
    height: 24px;
}

.sun svg {
    animation: rotate 15s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0);
    }
    100% {
        transform: rotate(360deg);
    }
}

.moon svg {
    animation: tilt 5s linear infinite;
}

@keyframes tilt {
    0% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.input:checked + .slider {
    background-color: #183153;
}

.input:focus + .slider {
    box-shadow: 0 0 1px #183153;
}

.input:checked + .slider:before {
    transform: translateX(30px);
}

/* Ajuste do mapa no modo escuro */
body.dark-mode .leaflet-container {
    background-color: #1a1a1a;
}

/* ===== LEGENDA CUSTOMIZADA ===== */
.custom-legend {
    background: rgba(255, 255, 255, 0.97);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #333;
    min-width: 15rem;
}

.custom-legend .legend-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.custom-legend .legend-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.custom-legend .legend-row:last-child {
    margin-bottom: 0;
}

.custom-legend .legend-dot {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.custom-legend .legend-dot.multi {
    background: radial-gradient(circle at 30% 30%, #7acc31, transparent 60%),
                radial-gradient(circle at 70% 30%, #e7d73d, transparent 60%),
                radial-gradient(circle at 50% 70%, #c73cbe, transparent 60%),
                #f6b347;
}

.custom-legend .legend-text {
    display: flex;
    flex-direction: column;
}

.custom-legend .legend-title {
    font-weight: 600;
    color: #333;
}

.custom-legend .legend-title span {
    font-weight: 500;
    color: #555;
    margin-left: 0.25rem;
}

.custom-legend .legend-desc {
    font-size: 0.75rem;
    color: #666;
}

body.dark-mode .custom-legend {
    background: rgba(26, 26, 26, 0.95);
    color: #e0e0e0;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.5);
}

body.dark-mode .custom-legend .legend-header {
    color: #f5f5f5;
}

body.dark-mode .custom-legend .legend-title {
    color: #fafafa;
}

body.dark-mode .custom-legend .legend-title span {
    color: #cfcfcf;
}

body.dark-mode .custom-legend .legend-desc {
    color: #b5b5b5;
}


/* ===== PAINEL DE INDICADORES ===== */
.indicators-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.25);
    padding: 1rem;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
}

.indicators-panel .stats-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f2f6fb;
    margin-bottom: 0.5rem;
}

.indicators-panel .stats-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.indicators-panel .stats-summary div {
    background: #f2f6fb;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.indicators-panel .stats-summary span {
    display: block;
    font-size: 0.7rem;
    color: #6c7b8a;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    margin-bottom: 0.25rem;
}

.indicators-panel .stats-summary strong {
    font-size: 1.3rem;
    color: #003f63;
}

.indicators-panel .stats-list {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 0.5rem;
    overflow-y: auto;
}

.indicators-panel .stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
    font-size: 0.85rem;
}

.indicators-panel .stats-item:last-child {
    border-bottom: none;
}

.indicators-panel .stats-item strong {
    color: #003f63;
}

.indicators-panel .stats-empty {
    font-size: 0.8rem;
    color: #888;
    padding: 0.5rem 0;
}

body.dark-mode .indicators-panel {
    background: rgba(20, 20, 20, 0.95);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.6);
}

body.dark-mode .indicators-panel .stats-summary div {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .indicators-panel .stats-summary span {
    color: #9fb9d4;
}

body.dark-mode .indicators-panel .stats-summary strong {
    color: #68b8ff;
}

body.dark-mode .indicators-panel .stats-item strong {
    color: #68b8ff;
}

body.dark-mode .indicators-panel {
    color: #f2f2f2;
}

@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        height: auto;
        width: 100%;
    }
    #map {
        width: 100%;
        height: 50vh;
    }
    #filtros {
        width: 100%;
        height: auto;
        padding: 1rem;
    }
    .titulo-container {
        margin-top: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .label-custom,
    .select-custom {
        width: 100%;
        max-width: 19.3125rem;
    }
    .btn-custom {
        width: 100%;
        max-width: 13.75rem;
        margin-top: 2rem;
    }
    .logo-text {
        width: auto;
    }
    img.logo-container{
        margin-top: 4rem;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
    .top-bar {
        width: 100%;
        margin: 0 0 0.75rem 0;
    }
}

@media (max-width: 600px) {
    #map {
        height: 45vh;
    }
    .titulo-filtros {
        font-size: 0.875rem;
        letter-spacing: 0.02rem;
        margin-top: 2rem;
    }
    .logo-text {
        font-size: 1.25rem;
    }
    .select-custom {
        height: 2.5rem;
        font-size: 0.875rem;
    }
    .btn-custom {
        height: 2.75rem;
        font-size: 0.9375rem;
    }
    .titulo-container {
        margin-top: 1.5rem;
    }
}


