@import url('font-awesome-all.css');
@import url('titilliumweb300.css');

* {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-family: 'Titillium Web', sans-serif;
    color: #204C8E;
    background: #CCCCCC;
}

/* Encabezado con dos logos */
.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10px;
    background: #CCCCCC;
    border-bottom: 1px solid #ddd;
}

.header img {
    height: 60px;
    object-fit: contain;
}

.header-center {
    text-align: center;
    flex: 1;
    /* ocupa espacio entre logos */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#nombreOperador {
    font-weight: bold;
    font-size: 18px;
}

#perfilOperador {
    font-size: 16px;
}

.logo-left {
    margin-right: 20px;
}

.logo-right {
    margin-right: 20px;
}

.login-container {
    margin: 80px auto;
    width: 300px;
    padding: 20px;
    background: gainsboro;
    border-radius: 6px;
    box-shadow: 0 0 10px #204C8E;
}

label {
    display: block;
    margin-top: 10px;
}

input {
    width: 90%;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    margin-top: 10px;
    padding: 10px;
    background: #204C8E;
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Titillium Web', sans-serif;
    font-size: 16px;
}

#message {
    margin-top: 10px;
    color: #204C8E;
    font-size: 0.9em;
}

.password-container {
    position: relative;
    width: 100%;
}



.password-container i {
    position: absolute;
    right: 1px;
    top: 50%;
    transform: translateY(-20%);
    cursor: pointer;
    color: #CCC;
}

.password-container i:hover {
    color: #204C8E;
}

/* Barra superior */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-left: 10px;
}

/* Contenedor de íconos */
.actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Ícono refresh */
.refresh-icon {
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* Ícono logout */
.logout-icon {
    font-size: 28px;
    cursor: pointer;
    color: #c0392b;
    transition: transform 0.2s ease, color 0.2s ease;
    padding-right: 20px;
}

.logout-icon:hover {
    transform: scale(1.2);
    color: #e74c3c;
}

/* Ícono refresh */
.action-icon {
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.filtro-estado {
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #204C8E;
    color: #204C8E;
    background-color: gainsboro;
    height: 28px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.dashboard-container {
    width: 100%;
    /* padding-left: 5px; */
}

.vehiculos-table {
    width: 100%;
    border-collapse: collapse;
}

.vehiculos-table th,
.vehiculos-table td {
    border: 1px solid #fff;
    padding: 2px;
    text-align: left;
    font-weight: bold;
}

.vehiculos-table th {
    background: #f0f0f0;
}

.vehiculos-table img {
    border-radius: 4px;
}

.vehiculos-table tr {
    display: flex;
    /* Fila en flex para igualar alturas */
    align-items: stretch;
    /* Que todas las celdas tengan la misma altura */
}

.vehiculos-table td {
    display: flex;
    /* Cada celda también es flex */
    align-items: stretch;
    padding: 0;
    /* Para no deformar alturas */
}

/* Celda de imagen */
.vehiculos-table td:first-child {
    width: 200px;
    justify-content: center;
    align-items: center;
}

/* Imagen */
.foto-wrapper {
    width: 200px;
    height: 200px;
    /* Define la altura total de la fila */
    overflow: hidden;
    border-radius: 6px;
    display: flex;
}

.foto {
    width: 110%;
    height: 130%;
    object-fit: cover;
    object-position: 70% 0%;
}

.col-info {
    flex: 1;
    /* Ocupar todo el espacio disponible */
    display: flex;
    flex-direction: row;
}

/* Grupo patente + hora */
.info-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
}

/* Patente */
.patente {
    font-weight: bold;
    padding-bottom: 20px;
    border-bottom: 1px solid #fff;
    font-size: clamp(30px, 8vw, 70px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;

    flex: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hora */
.hora {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Estado */
.estado-full {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
    font-weight: bold;

    border-left: 1px solid #fff;

    padding: 0 10px;
    /* ← solo padding horizontal */
    text-align: center;

    overflow: hidden;
    /* ← evita que desborde */
}

/* Oculto por defecto */
.rotate-alert {
    display: none;
}

.wait-message {
    width: 100%;
    font-size: 32px;
    text-align: center;
    padding: 20px;
}

.detalle-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: gainsboro;
    border-radius: 6px;
    box-shadow: 0 0 10px #204C8E;
    max-width: 600px;
    margin: 20px;
}

.detalle-foto {
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 6px;
}

.detalle-foto img {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* muestra la imagen completa */
    border-radius: 6px;
}

.datos-vehiculo {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.info-row .label {
    font-weight: bold;
    min-width: 120px;
}

#estadoSelect {
    padding: 5px;
    border-radius: 4px;
    border: none;
    display: block;
}

.modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    display: none;
    background: #ccc;
}

.modal-content {
    background: gainsboro;
    padding: 20px;
    width: 350px;
    margin: 10% auto;
    border-radius: 8px;
}

.modal-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.btn-guardar {
    background: #888;
    color: white;
    padding: 8px 12px;
}

.btn-cerrar {
    background: #888;
    color: white;
    padding: 8px 12px;
}

.users-container {
    padding: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.users-table th,
td {
    border: 1px solid #fff;
    padding: 8px;
    text-align: center;
}

.users-table th {
    background: gainsboro;
}

/* Alert de rotación */
@media (max-width: 600px) and (orientation: portrait) {
    .rotate-alert {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.85);
        color: white;
        z-index: 9999;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 20px;
        animation: fadeIn 0.5s ease-out;
    }

    .rotate-icon {
        font-size: 120px;
        margin-bottom: 20px;
        animation: rotatePhone 2s infinite ease-in-out;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes rotatePhone {
    0% {
        transform: rotate(0deg);
    }

    50% {
        transform: rotate(90deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@font-face {
    font-family: 'Titillium Web';
    font-style: normal;
    font-weight: 300;
    src: local('Titillium WebLight'), local('TitilliumWeb-Light'), url(/fonts/titilliumweb.woff) format('woff');
}

@media (max-width: 600px) {
    .patente {
        font-size: clamp(26px, 8vw, 40px);
    }

    .detalle-container {
        padding: 15px;
    }
}