@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #1a1a1a;
    overflow-x: hidden;
    max-width: 100%;
}

.container {
    margin: 0 auto;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Add max-width for desktop screens */
@media screen and (min-width: 768px) {
    .container {
        max-width: 860px;
    }
}

h1, h2 {
    color: #1a1a1a;
    text-align: center;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.logo {
    display: block;
    max-width: 180px;
    margin: 0 auto 20px;
    transition: transform 0.2s;
}

.logo:hover {
    transform: scale(1.05);
}

#map {
    height: 300px;
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
}

.legend-container {
    background-color: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.legend-symbols {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    width: 100%;
    justify-content: center;
}

.legend-item svg {
    width: 32px;
    height: 32px;
}

.legend-item.active {
    background-color: #f0f9ff;
    border: 2px solid #2563eb;
    font-weight: 500;
}

.legend-item.inactive {
    opacity: 0.6;
}

.legend-item:hover {
    background-color: #f0f9ff;
}

.legend-item .marker.quinzenal {
    color: #2563eb;
}

.legend-item .marker.semanal {
    color: #16a34a;
}

.legend-item .calendar-icon {
    color: #6366f1;
}

.marker {
    display: inline-block;
    width: 24px;
    height: 24px;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quinzenal {
    background-color: #2563eb;
}

.semanal {
    background-color: #16a34a;
}

.calendar-icon {
    font-size: 20px;
}

/* Mobile-first table styles */
.legend-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Card-based layout for all screens */
.legend-table thead {
    display: none; /* Hide table headers */
}

.legend-table, .legend-table tbody, .legend-table tr, .legend-table td {
    display: block;
    width: 100%;
    text-align: left;
}

.legend-table tr {
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: white;
    padding: 12px;
    position: relative;
}

.legend-table td {
    border: none;
    padding: 12px 16px;
    position: relative;
    padding-left: 140px;
    font-size: 16px;
    line-height: 1.4;
    vertical-align: middle;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-all;
}

.legend-table td:before {
    position: absolute;
    left: 16px;
    white-space: nowrap;
    font-weight: 600;
    content: attr(data-label);
    font-size: 14px;
    color: #4b5563;
}

.legend-table td:nth-of-type(1):before { content: "Responsáveis:"; }
.legend-table td:nth-of-type(2):before { content: "Bairro(s):"; }
.legend-table td:nth-of-type(3):before { content: "Frequência:"; }
.legend-table td:nth-of-type(4):before { content: "Dias/Detalhes:"; }
.legend-table td:nth-of-type(4) {
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    overflow-wrap: break-word;
    padding-right: 5px;
    box-sizing: border-box;
}

.legend-table td:nth-of-type(4):before {
    white-space: nowrap;
    margin-bottom: 5px;
    display: block;
}

.legend-table td:nth-of-type(4) {
    padding-top: 35px !important;
}
.legend-table td:nth-of-type(5):before { content: ""; }

.legend-table td:last-child {
    padding: 12px 0 0 0;
    text-align: center;
}

/* Custom popup styling for all screen sizes */
.custom-popup .leaflet-popup-content {
    margin: 10px 12px;
    line-height: 1.4;
    max-width: 240px;
    font-size: 16px;
}

.custom-popup .leaflet-popup-content h3 {
    font-size: 18px;
}

.custom-popup .leaflet-popup-content p {
    margin: 8px 0;
    font-size: 16px;
}

.custom-popup .leaflet-popup-content a {
    padding: 6px 10px;
}

.whatsapp-btn {
    display: inline-block;
    background-color: #25D366;
    color: white !important;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 8px;
    margin-bottom: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    max-width: 180px;
    text-align: center;
    width: auto;
    font-size: 14px;
}

.whatsapp-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.whatsapp-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.legend-symbols h4 {
    text-align: center;
    margin: 12px 0;
    width: 100%;
}