/* VARIABLES Y CONFIGURACIÓN BASE */
:root {
    --color-primario: #0056b3;
    --color-oscuro: #004494;
    --fondo-cuerpo: #f0f4f8;
    --texto-principal: #333;
    --borde: #e1e4e8;
    --blanco: #ffffff;
    --rojo-error: #dc3545;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--fondo-cuerpo);
    color: var(--texto-principal);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* BARRA SUPERIOR */

.barra-superior {

    color: var(--blanco);
    padding: 0px 40px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid #a9afb6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.barra-superior img {
    height: 100px;
    padding: 8px;
    border-radius: 6px;
}

.titulo-centro {
    text-align: center;
    padding: 0 15px;
    color: var(--color-oscuro);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.titulo-centro h1 {
    font-size: 2rem;
    margin-bottom: 4px;
    
}

.titulo-centro p {
    font-size: 1rem;
    font-weight: 1000px;
}

/*ESTRUCTURA PRINCIPAL Y TARJETA*/
.contenedor-principal {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alineado arriba */
    padding: 40px 20px;
}

.tarjeta {
    background-color: var(--blanco);
    width: 100%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--borde);
}

.cuerpo-tarjeta {
    padding: 30px;
    
}


/*FORMULARIO Y ALINEACIÓN*/
.etiqueta {
    display: block;        
    margin-bottom: 8px;    
    font-weight: 600;
    color: #2c3e50;
    text-align: left;      
    width: 100%;
}

.contenedor-controles {
    display: flex;
    gap: 10px;             /* Espacio entre el input y el botón */
    flex-wrap: wrap;       /* Para que baje en celulares */
    justify-content: center; 
    align-items: flex-end; 
}

.caja-input {
    display: flex;
    flex-direction: column; /* Apila Título arriba / Input abajo */
    flex-grow: 0;           /* No estirarse de más */
    width: 100%;
    max-width: 350px;       
}

input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--borde);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

input[type="text"]:focus {
    border-color: var(--color-primario);
}

.boton-consultar {
    background-color: var(--color-primario);
    color: var(--blanco);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex-grow: 0;           /* Botón compacto */
    width: auto;
    height: fit-content;    
    }

.boton-consultar:hover {
    background-color: var(--color-oscuro);
}

/*TABLA DE RESULTADOS*/
#resultsArea {
    margin-top: 30px;
    border-top: 2px dashed var(--borde);
    padding-top: 20px;
}

.encabezado-resultados {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
}

.titulo-resultados {
    font-size: 1.1rem;
    color: var(--color-primario);
}

.contador-badge {
    background: #e3f2fd;
    color: var(--color-primario);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;

    position: absolute; 
    right: 0;           /* Pegado al borde derecho */
    top: 50%;           /* Centrado verticalmente... */
    transform: translateY(-50%); /* ...ajuste fino para que quede perfecto al medio */
}

.contenedor-tabla {
    overflow-x: auto;
    border: 1px solid var(--borde);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 450px;
    
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--borde);
    text-align: center;
    
    
}

th {
    background-color: #f8f9fa;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #555;
    
    
}

tbody tr:hover {
    background-color: #f1f8ff;
}

/* (Loading, Error, Footer)*/
.hidden { display: none !important; }

.loading {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.spinner {
    width: 35px;
    height: 35px;
    border: 4px solid #f3f3f3;
    border-top-color: var(--color-primario);
    border-radius: 50%;
}

.caja-error {
    background-color: #fff5f5;
    color: var(--rojo-error);
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid var(--rojo-error);
    margin-top: 15px;
}


.pie-pagina {
    background-color: #f8f9fa;
    padding: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid var(--borde);

}

/*estilos propietario*/
.propietario{
    margin-top: 20px;
    text-align: center;
    padding-bottom: 15px;
}

.propietario h3 {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.propietario div{
    font-size: 1.1rem; 
    color: #333;
}

.cedula-propietario{
    color: #1e3a8a;
}

/*estilos multas*/


/*para cerrar sesion*/

/*.btn-logout {
    background-color: #ef4444; 
    color: white;
    border: none;
    padding: 8px 15px;
    margin-right: 15px; 
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-logout:hover {
    background-color: #b91c1c; 
}*/

/* Ajuste para que el logo y el botón queden alineados en el nav */
.logo-der {
    display: flex;
    align-items: center;
}



/* MEDIA QUERY: ESTILOS PARA CELULARES */
@media (max-width: 768px) {

    .barra-superior {
        flex-wrap: wrap; 
        justify-content: center; 
        padding: 15px 10px; 
    }

    .logo-izq { order: 1; margin-right: auto; }
    .logo-der { order: 2; margin-left: auto; }

    .titulo-centro {
        order: 3; 
        width: 100%; 
        margin-top: 10px; 
    }

    .barra-superior img { height: 60px; }
    .titulo-centro h1 { font-size: 1.3rem; }
    .titulo-centro p { font-size: 0.9rem; }


    .contenedor-principal {
        padding: 20px 10px; /* Menos margen a los lados de la pantalla */
    }

    .cuerpo-tarjeta {
        padding: 20px 15px; /* Menos relleno interno */
    }

    input[type="text"] {
        padding: 8px 10px; /* Reducimos el relleno del input (era 12px) */
        font-size: 0.9rem; /* Letra un poco más pequeña */
        height: 40px;      /* Altura fija para control */
    }

    .boton-consultar {
        padding: 8px 20px; /* Botón menos "gordo" */
        font-size: 0.9rem; 
        height: 40px;      /* Misma altura que el input para que alineen bien */
        display: flex;     /* Para centrar el texto verticalmente */
        align-items: center;
    }

    .etiqueta {
        font-size: 0.85rem; /* Etiqueta "Placa" más pequeña */
        margin-bottom: 4px;
    }

    .caja-input {
        max-width: 100%; 
    }

    .propietario h3 {
        font-size: 0.8rem;
    }
    
    .propietario div {
        font-size: 0.95rem; 
    }

    /* Encabezado de la tabla */
    .titulo-resultados {
        font-size: 1rem;
    }

    .encabezado-resultados {
        justify-content: space-between; /* Separar título del badge */
        gap: 5px; 
        margin-bottom: 10px;
    }

    .contador-badge {
        position: static; 
        transform: none;
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    /* Tabla compacta */
    table {
        min-width: auto; 
        width: 100%;   
        table-layout: fixed; 
    }

    th, td {
        font-size: 0.75rem; /* Letra pequeña (aprox 12px) */
        padding: 8px 4px;   /* Menos relleno en celdas */
        white-space: normal; 
        word-wrap: break-word; 
    }

    
    /* Anchos de columna optimizados */
    th:nth-child(1) { width: 20%;} /* Placa */
    th:nth-child(2) { width: 50%; } /* Descripción */
    th:nth-child(3) { width: 30%; } /* Último pago */

    

    /* Botón de recibo dentro de la tabla */
    .btn-recibo {
        font-size: 0.75rem; /* Botón "Ver" más pequeño */
        padding: 3px 6px;
    }
    
    .badge-anio {
        font-size: 0.75rem;
        padding: 1px 5px;
    }

    .contenedor-tabla table tr td:nth-child(1) {
        font-size: 0.2rem !important; 
        font-weight: 700; 
        letter-spacing: -0.5px; 
    }
    
    .contenedor-tabla table tr th:nth-child(1) {
        font-size: 0.65rem !important;
    }
}

@media (max-width: 480px) {
    .contenedor-tabla table tbody tr td:first-child div {
        font-size: 0.85rem; 
    }

    #tablaMultasContainer table tbody tr td:nth-child(1) {
        font-size: 10px !important;     
        font-weight: bold !important;   /* Negrita */
        color: #333;                    /* Color oscuro para que se lea bien */
        
        display: table-cell !important; 
        vertical-align: middle !important; 
        text-align: center !important;     
        
        white-space: nowrap;           
        padding: 15px 5px !important;   
        border-bottom: none !important; 
    }
}

#mensajeSinMultas{
    text-align: center;
    padding: 20px;
    color: green;
    font-weight: bold;
    background-color: var(--blanco);
    border-radius: 8px;
    border: 1px solid green;
}

.encabezado-resultados {
        display: flex;
        flex-wrap: wrap;         
        justify-content: center; 
        align-items: center;    
        width: 100%;
    }

    .titulo-resultados {
        font-size: 0.95rem; 
    }

    .contador-badge {
        position: static; 
        transform: none;
        font-size: 0.7rem;
        padding: 2px 8px;
    }

/* validaciones error */
.input-error {
    border-color: var(--rojo-error) !important;
    background-color: #fff8f8; 
}

/*  mensajito de abajo */
.msg-error-input {
    color: var(--rojo-error);
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 600;
    display: block; 
}


small.hidden {
    display: none;
}


/* Contenedor para alinear año y botón */
.contenedor-pago {
    display: flex;
    align-items: center;
    justify-content: center; /* Centra horizontalmente año + botón dentro de la celda */
    gap: 5px; /* Espacio entre el año y el botón */
    width: 100%;
}

/* Estilo del año (opcional, para que resalte) */
.badge-anio {
    font-weight: bold;
    color: #0056b3;
    background-color: #e7f1ff;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Estilo del botón de recibo */
.btn-recibo {
    background-color: var(--color-primario);
    font: 0.9em sans-serif;
    color: var(--blanco);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 400;
    cursor: pointer;
    flex-grow: 0;          
    width: auto;
    height: fit-content; 
}

.btn-recibo:hover {
    background-color: var(--color-oscuro);
}


/* ESTILOS DE LA VENTANA MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Fondo oscuro transparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Para que quede encima de todo */
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px; /* Ancho máximo */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: fadeIn 0.3s;
}

.modal-header {
    background-color: var(--color-primario);
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/*.btn-cerrar {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.btn-cerrar:hover {
    color: #ffcccc;
}*/

/* Alerta de vehículo no registrado */
.aviso-no-registrado {
    background-color: #fff3cd;
    color: #856404;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid #ffeeba;
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

