/* MAIN */
* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    width: 100%;
}

main {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    background-color: black;
    height: 100vh;
}

/* SISMICIDADE */
.seismic {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.seismic-map {
    position: relative;
    width: 100%;
    height: 80vh;
    transition: height 0.3s ease;
}

#map {
    width: 100%;
    height: 100%;
}

.map-legend {
    background-color: rgba(255, 255, 255, 0.7);
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-family: Arial, sans-serif;
    font-size: 14px;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 1000;
    cursor: grab;
    user-select: none;
    touch-action: none;
    cursor: grab;
}

.map-legend h3 {
    margin: 0;
}

.legend-section p {
    margin-top: 10px;
    margin-bottom: 5px;
}

.legend-box {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: auto;
}

.legend-box i {
    font-size: 20px;
    color: red;
    margin-right: 10px;
}

.legend-box.red {
    background-color: red;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.legend-box.orange {
    background-color: orange;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.legend-box.yellow {
    background-color: yellow;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
}

.legend-box.felt {
    background-color: transparent;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid red;
}

.legend-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.legend-circle {
    display: inline-block;
    border-radius: 50%;
    background-color: transparent;
    border: 1px solid black;
    margin-right: 10px;
}

.legend-table {
    width: 100%;
    border-collapse: collapse;
}
  
.legend-table td {
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

.map-custom-buttons {
    position: absolute;
    top: 80px;
    left: 10px;
    z-index: 1000; /* acima do mapa */
    display: flex;
    flex-direction: column;
    gap: 6px;
}
  
.map-custom-buttons button {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
    min-width: 100px;
    text-align: center;
}
  
.map-custom-buttons button:hover {
    background-color: #f0f0f0;
}

/* Quando o mapa está retraído, esconder os botões */
.seismic-map.collapsed .map-custom-buttons {
    display: none;
}

/* TABELA */
.earthquakes {
    width: 100%;
    transition: height 0.3s ease;
    height: 20vh;
    position: relative;
    z-index: 1100;
    background-color: black;
}

.table-scroll {
    height: 100%;
    overflow-y: auto;
}

.table-scroll table {
    width: 100%;
    border-collapse: collapse;
}

.earthquakes table  {
    width: 100%;
    max-height: 500px;
    overflow-y: auto;
    border-collapse: collapse;
    background-color: black;
    color: white;
    font-size: 13px;
}

.earthquakes th {
    position: sticky;
    top: 0;
    border: 2px solid black;
    text-align: center;
    background-color: red;
    font-size: 15px;
}

.earthquakes td {
    padding: 4px;
    text-align: left;
}

.table-center {
    text-align: center;
}

.high-intensity {
    color: red;
}

.zoom {
    text-decoration: underline;
    cursor: pointer;
}

.tabela-flutuante {
    position: fixed;
    bottom: 50px;
    left: 10px;
    width: 80vh;
    max-height: 30vh;
    background: white;
    z-index: 1100;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1000px) {
    .map-legend {
      font-size: 12px;
      padding: 4px;
      top: 5px;
      right: 5px;
      max-width: 90%;
      overflow-y: auto;
      max-height: 25vh;
    }
  
    .legend-section p {
      font-size: 13px;
      margin-bottom: 3px;
    }
  
    .legend-box i {
      font-size: 16px;
      margin-right: 6px;
    }
  
    .legend-box.red,
    .legend-box.orange,
    .legend-box.yellow {
      width: 16px;
      height: 16px;
      margin-right: 6px;
    }

    .legend-table td {
        font-size: 12px;
    }
  
    .map-custom-buttons {
        position: absolute;
        left: 10px;
        gap: 4px;
        transition: top 0.3s ease;
    }
  
    .map-custom-buttons button {
      padding: 4px 8px;
      font-size: 12px;
    }
    
    /* Normal (mapa expandido) */
    .seismic-map:not(.collapsed) ~ .map-custom-buttons {
        top: 400px;
    }
    
    /* Quando mapa está retraído */
    .seismic-map.collapsed ~ .map-custom-buttons {
        top: 85px; /* ajusta se quiseres mais acima/abaixo */
    }
  
    th {
      font-size: 10px;
    }
  
    td {
      font-size: 12px;
    }
  
    .tabela-flutuante {
      width: 95vw;
      left: 2.5vw;
    }
}