@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

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

a{
    text-decoration: none;
    color: white;
}
a:hover{
    text-decoration: underline;
}

/* html y body ocupan el 100% de la ventana */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

/* El wrapper directo (el <div> que envuelve header+contenido+footer) crece y es flex-column */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > div {
    flex: 1;
    display: flex;
    flex-direction: column;
}

h1, h2, h3{
    font-family: 'Oswald', sans-serif;
    font-weight: 350;
    letter-spacing: 0.2em;
}

p, span, label, td{
    font-family: 'Roboto', sans-serif;
}

/* Cabecera */
header {
    background-color: #283a18;
    padding: 1rem 0;
    flex-shrink: 0;
}

#divCabecera {
    display: flex;
    justify-content: center;
    align-items: center;
}

#contenedorLogoMenus {
    width: 85%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

#divLogoTitulo {
    width: 40%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#divTitulo{
    color: white;
}

#divLogoHeader img {
    height: 5rem;
    width: 5rem;
}

/* Menús */
#divmenus {
    display: flex;
    gap: 1rem;
}

#divmenus button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    background-color: rgba(133, 163, 58, 0.28);
    color: #a9d636;
    border-radius: 5px;
    border: 1px solid;
}

/* Contenido principal */
#contenido {
    flex-grow: 1;            /* ocupa todo el espacio disponible */
    display: flex;
    justify-content: center;

    background-color: #e1cda1;
    min-height: 0;           /* para que flex-grow funcione bien */
    background-image: url("../imagenes/FONDO1.jpg");
    /* Opcionales para personalizar cómo se muestra */
    background-size: cover;         /* Cubre toda la pantalla */
    background-position: center;    /* Centra la imagen */
    background-repeat: no-repeat;   /* No la repite */
    background-attachment: fixed;
}

#contenedorContenido {
    width: 85%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    margin-top: 1rem;
}

/* Footer */
footer {
    background-color: #283a18;
    padding: 1.5rem 0;
    flex-shrink: 0;
}

#divFooter {
    display: flex;
    justify-content: center;
    color: white;
}

#contenedorElementosFooter {
    width: 85%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

#divLogoFooter {
    height: 2rem;
    width: 2rem;
    flex-shrink: 0;
}

#divLogoFooter img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Elementos informativos del footer */
.informacionFooter {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    font-size: 0.7em;
}


/*--------------------------------------------------------------------*/
/*----------------------ESTILOS INDEX---------------------------------*/
/*--------------------------------------------------------------------*/

.intro-carousel {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.77);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 2rem;
    color: #283a18;
}

.carousel-card {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.carousel-card.active {
    display: block;
}

.carousel-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.carousel-card p,
.carousel-card ul {
    font-size: 1rem;
    line-height: 1.6;
}

.carousel-nav {
    text-align: center;
    margin-top: 1rem;
}

.carousel-nav button {
    background-color: #578230;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.5rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.carousel-nav button:hover {
    background-color: #578230;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}




/*-------------------------------------------------------------------------------*/
/*----------------------ESTILOS FILTROS PARCELAS---------------------------------*/
/*-------------------------------------------------------------------------------*/

.divFiltros{
    background-color: rgba(255, 255, 255, 0.77);
    border-radius: 5px;
}

#contenedorParcelasFiltradas {
    display: flex;
    flex-direction: column;
    flex: 1;              /* ocupar espacio restante */
    min-height: 0;        /* fundamental para que hijos con flex:1 respeten límites */
}

#parcelas-lista:empty::before {
    content: "(cargando parcelas)";
    display: flex;
    color: #666;
    font-style: italic;
    text-align: center;
    align-items: center;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px dashed #aaa;
    border-radius: 6px;
}


#parcelas-lista {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    column-gap: 0.5rem;
    row-gap:    0.25rem;

    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.77);
    border-radius: 0.25rem;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.1),
        0 1px 2px rgba(0,0,0,0.06);

    min-height: 0;
    height: 60vh;
    overflow-y: auto;
    text-align: center;
    justify-content: center;
}


#titulo-provincia {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.prov-title {
    width: 100%;
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.parcela-chip {
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.5rem;
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
    width: 79.5px;
}

.parcela-chip:hover {
    background-color: #f3f4f6;
}

.parcela-chip a {
    color: #578230;
    text-decoration: none;
}

.parcela-chip a:hover {
    text-decoration: underline;
}

#parcelas-lista p {
    width: 100%;
    color: #374151;
}

#parcelas-lista p.error {
    color: #dc2626;
}

/*----------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------*/

#tituloDatosParcela{
    margin-bottom: 1rem;
}

#identificadorDatosParcela{
    display: flex;
}


.contenedorMapa2D {
    display: flex;
    align-items: center;
    justify-content: center;
}
#mapa2d{
    height: 50vh;
    width: 50vh;
}
#mapa3d{
    height: 80vh;
    width: 80vh;
}

canvas{
    border-radius: 5px;
}

#tooltip-arbol {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #cccccc;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    max-width: 250px;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    display: none;
}


#displayInformacionParcela {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1em;
}


#datosParcela {
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 5px;
}

#datosParcela .fila-dato {
    display: flex;
    margin: 0.5em;
    align-items: baseline;
}

#datosParcela h3 {
    margin: 0;
    font-weight: bold;
}

#datosParcela p {
    margin: 0;
}

#datosPies {
    max-height: 30vh;
    overflow-y: auto;
}
#contenedorDivExportarDatos{
    display: flex;
    align-items: center;
    justify-content: center;
}

#divExportarDatos{
    margin-top: 1em;
    margin-bottom: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 5px;
    padding: 1em;
    width: 20%;
}

#divBotonVolver{
    margin-top: 1em;
    margin-bottom: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
}
#botonVolver {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    background-color: #283a18;
    color: #a9d636;
    border-radius: 5px;
    border: 1px solid;
}


/*----------------------------------------------------------------------------------*/
/*-------------------------------TABLA DATOS PIES-----------------------------------*/
/*----------------------------------------------------------------------------------*/

/* Estilo general */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
}

.responsive-table th,
.responsive-table td {
    padding: 7px;
    text-align: center;
}
.responsive-table td{
    border-top: 1px solid #ccc;
}



/*----------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------*/

/* MAPA */
#contenedorMapa{
    height: 90%;
}

#divMapa {
    height: 90%;
    border-radius: 12px;
}

.divFiltros {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

#filtroIncendios{
    display: flex;
    align-items: flex-end;
}


/*----------------------------------------------------------------------------------*/
/*--------------------------------RESPONSIVE----------------------------------------*/
/*----------------------------------------------------------------------------------*/

/*--TABLET--*/
@media (min-width: 900px) and (max-width: 1380px) {
    #displayInformacionParcela{
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 1rem;
    }

    #contenedorMapa2D{
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #mapa2d{
        height: 35rem;
        width: 35rem;
    }
    #mapa3d{
        height: 35rem;
        width: 35rem;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table{
        background-color: transparent;
    }

    .responsive-table tr{
        background-color: rgba(255, 255, 255, 0.7);
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tbody{
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .responsive-table tr {
        margin-bottom: 1rem;
        border-radius: 4px;
        padding: 8px;
        width: 31%;
    }

    .responsive-table td{
        border: none;
    }
    .responsive-table td:not(:first-child) {
        border-top: 1px solid #eee;
    }

    .responsive-table td{
        text-align: right;
        position: relative;
        padding-left: 50%;
        min-height: 2.5em;
    }

    .responsive-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 8px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
    }

    /*------------------------------------------*/
    /*-------------------MAPA-------------------*/
    /*------------------------------------------*/
    .divFiltros{
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 5px;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .divFiltros {
        display: flex;
        justify-content: space-around;
        margin-bottom: 1rem;
    }

    #filtroIncendios{
        display: flex;
        align-items: flex-end;
    }

    #contenedorMapa{
        flex-grow: 1;
        height: 30rem;
    }

    #divMapa{
        height: 95%;
    }

    #contenedorElementosFooter{
        flex-direction: row;
    }

    #divLogoFooter{
        display: none;
    }

}


@media (min-width: 768px) and (max-width: 900px) {

    #contenedorLogoMenus {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 1rem;
    }

    #divLogoTitulo {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    #divmenus {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #divmenus button {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    #contenedorContenido {
        width: 95%;
        padding: 0.5rem;
    }

    /*---------------------------------------------------*/
    /*-------------------DATOS PARCELA-------------------*/
    /*---------------------------------------------------*/

    #tituloDatosParcela{
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 5px;
        padding: 0.5rem;
        width: 68%;
    }

    #displayInformacionParcela{
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 1rem;
    }

    #contenedorMapa2D{
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #mapa2d{
        height: 35rem;
        width: 35rem;
    }
    #mapa3d{
        height: 35rem;
        width: 35rem;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table{
        background-color: transparent;
    }

    .responsive-table tr{
        background-color: rgba(255, 255, 255, 0.7);
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tbody{
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .responsive-table tr {
        margin-bottom: 1rem;
        border-radius: 4px;
        padding: 8px;
        width: 31%;
    }

    .responsive-table td{
        border: none;
    }
    .responsive-table td:not(:first-child) {
        border-top: 1px solid #eee;
    }

    .responsive-table td{
        text-align: right;
        position: relative;
        padding-left: 50%;
        min-height: 2.5em;
    }

    .responsive-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 8px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
    }



    #divExportarDatos{
        width: auto;
    }

    .divFiltros {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem;
        gap: 1rem;
    }

    .divFiltros input[type="text"],
    .divFiltros select {
        width: 80%;
    }

    #divExportarDatos {
        width: auto;
        flex-direction: column;
    }

    footer {
        padding: 1rem;
    }

    #contenedorElementosFooter {
        flex-wrap: nowrap;
        align-items: center;
        gap: 1rem;
    }

    #divLogoFooter{
        display: none;
    }

    .informacionFooter {
        font-size: 0.75em;
        text-align: center;
    }

    /*------------------------------------------*/
    /*-------------------MAPA-------------------*/
    /*------------------------------------------*/
    .divFiltros{
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 5px;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .divFiltros {
        display: flex;
        justify-content: space-around;
        margin-bottom: 1rem;
    }

    #filtroIncendios{
        display: flex;
        align-items: flex-end;
    }


    #contenedorMapa{
        flex-grow: 1;
        height: 30rem;
    }

    #divMapa{
        height: 95%;
    }
}




/*--MOVILES--*/
@media screen and (max-width: 768px) {

    #contenedorLogoMenus{
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    #divLogoTitulo{
        display: flex;
        flex-direction: column;
        width: 90%;
        gap: 0rem;
    }
    #divTitulo{
        text-align: center;
    }

    #contenido {
        flex-grow: 1;
        display: flex;
        justify-content: center;

        background-color: #e1cda1;
        min-height: 0;
        background-image: url("../imagenes/FONDO_MOVIL.jpg");

        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }

    #contenedorContenido {
        width: 85%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
        margin-top: 1rem;
    }

    footer{
        display: none;
    }

    /*---------------------------------------------------*/
    /*-------------------DATOS PARCELA-------------------*/
    /*---------------------------------------------------*/

    #tituloDatosParcela{
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 5px;
        padding: 0.5rem;
        display: flex;
        flex-direction: column;
        text-align: center;
    }
    #identificadorDatosParcela{
        display: flex;
        flex-direction: column;
    }

    #displayInformacionParcela{
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    #contenedorMapa2D{
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #mapa2d{
        height: 20rem;
        width: 20rem;
    }
    #mapa3d{
        height: 20rem;
        width: 20rem;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table{
        background-color: transparent;
    }

    .responsive-table tr{
        background-color: rgba(255, 255, 255, 0.7);
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        margin-bottom: 1rem;
        border-radius: 4px;
        padding: 8px;
    }

    .responsive-table td{
        border: none;
    }
    .responsive-table td:not(:first-child) {
        border-top: 1px solid #eee;
    }

    .responsive-table td{
        text-align: right;
        position: relative;
        padding-left: 50%;
        min-height: 2.5em;
    }

    .responsive-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 8px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
    }

    #divExportarDatos{
        width: auto;
    }

    /*------------------------------------------*/
    /*-------------------MAPA-------------------*/
    /*------------------------------------------*/
    .divFiltros{
        flex-wrap: wrap;
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 5px;
        gap: 0.5rem;
        justify-content: start;
        padding: 0.5rem;
    }

    .divFiltros div{
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .divFiltros input[type="text"],
    .divFiltros select {
        width: 60%;
    }

    #filtroIncendios{
        width: 100%;
    }


    #contenedorMapa{
        height: 30rem;
    }

    #divMapa{
        height: 95%;
    }

}
