/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    height: 60px;
}

.menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag-icon {
    height: 22px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.2s;
}

.flag-icon:hover {
    transform: scale(1.1);
}

/* Contraste botão */
#toggle-contraste {
    background: #222;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    margin-left: 10px;
}

/* Contraste alto */
body.contraste-alto {
    background-color: #000 !important;
    color: #fff !important;
}

body.contraste-alto a,
body.contraste-alto .btn,
body.contraste-alto select,
body.contraste-alto input {
    color: #fff !important;
    background-color: #000 !important;
    border: 2px solid #fff !important;
}

body.contraste-alto header,
body.contraste-alto footer {
    background: #111 !important;
}

/* Layout principal */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 960px;
    margin: auto;
    padding: 20px;
}

/* Rodapé */
footer {
    background-color: #007bff;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 14px;
}

/* Botões */
.btn {
    background-color: #28a745;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 6px;
    display: inline-block;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn:hover {
    background-color: #218838;
}

/* Filtros */
.filtros {
    background-color: #f1f1f1;
    padding: 15px;
}

.filtros-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.filtros-flex input[type="text"],
.filtros-flex select,
.filtros-flex .btn {
    padding: 10px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
    outline: none;
}

/* Mapa */
#map {
    width: 100%;
    min-height: 400px;
    max-height: 90vh;
    border-radius: 6px;
    margin: 0 auto;
}

/* Card de serviço (lista.php) */
.card-servico {
    display: flex;
    gap: 15px;
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 6px;
    background: #fff;
    align-items: center;
    transition: box-shadow 0.2s ease;
}

.card-servico:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card-servico .thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-servico .thumb img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.card-servico .info {
    flex-grow: 1;
}

.card-servico .info strong {
    font-size: 16px;
}

.card-servico .info span {
    font-size: 14px;
    color: #555;
}

/* Ações (index) */
.acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.card-acao {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    width: 250px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.card-acao:hover {
    transform: translateY(-5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.card-acao .icone {
    font-size: 36px;
    margin-bottom: 10px;
}

.card-acao .titulo {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.card-acao .desc {
    font-size: 14px;
    color: #666;
}

/* Imagem explicativa (index) */
.imagem-explicativa {
    max-width: 100%;
    margin-top: 20px;
    border-radius: 6px;
}

/* Tabelas responsivas */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.responsive-table thead {
    background-color: #007bff;
    color: #fff;
}

.responsive-table th,
.responsive-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

@media (max-width: 768px) {
    .responsive-table thead {
        display: none;
    }

    .responsive-table tr {
        display: block;
        margin-bottom: 15px;
        background: #fff;
        border-radius: 6px;
        box-shadow: 0 0 5px #ccc;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: bold;
        flex-basis: 40%;
        color: #555;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .filtros-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .filtros-flex .btn,
    .filtros-flex select,
    .filtros-flex input[type="text"] {
        width: 100%;
    }

    .card-servico {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-servico .thumb {
        width: 100%;
        height: auto;
        margin-bottom: 10px;
    }

    .card-acao {
        width: 100%;
    }

    #toggle-contraste {
        position: static;
        margin: 10px auto 0;
        display: block;
    }
}

/* Modo Escuro */
body.modo-escuro {
    background-color: #1c1c1c;
    color: #f1f1f1;
}

body.modo-escuro header,
body.modo-escuro footer {
    background-color: #2a2a2a;
}

body.modo-escuro .filtros,
body.modo-escuro .card,
body.modo-escuro .container {
    background-color: #2c2c2c;
    color: #f1f1f1;
}

body.modo-escuro a {
    color: #89c9ff;
}

body.modo-escuro .btn {
    background-color: #555;
    color: #fff;
}

body.modo-escuro .btn:hover {
    background-color: #666;
}

/* Detalhes do Serviço */
.detalhes-servico {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    margin-top: 30px;
}

.detalhes-servico h2 {
    margin-bottom: 15px;
    color: #007bff;
}

.detalhes-servico p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.categoria-badge {
    display: inline-block;
    background: #ccc;
    padding: 5px 10px;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    margin: 2px 5px 2px 0;
}

#map {
    height: 300px;
    width: 100%;
    margin-top: 20px;
    border-radius: 6px;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .btn-group {
        flex-direction: column;
    }
}
