/* Estilos generales */
body, h1, h2, th, td, input, button, a {
    text-transform: uppercase;
}

.form-input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 100px rgba(0,0,0,0.1);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 18px;
}

button {
    padding: 10px 15px;
    border: none;
    background-color: #28a745;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    margin-top: 10px;
}

button:hover {
    background-color: #218838;
}

#btn-qr {
    background-color: #007BFF;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#btn-qr:hover {
    background-color: #0069d9;
}

.results {
    margin-top: 20px;
}

.results table {
    width: 100%;
    border-collapse: collapse;
}

.results th, .results td {
    padding: 8px;
    border: 1px solid #ddd;
}

.results th {
    background-color: #f8f8f8;
}

/* Estilos para el lector QR */
#qr-reader {
    display: none;
    width: 100%;
    aspect-ratio: 16 / 9; /* Cambiado a formato rectangular */
    margin: 20px auto;
    max-width: 800px;
}

#qr-reader video {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: contain; /* Cambiado para mantener la proporción */
}

/* Estilos para móvil mejorados */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .results table {
        font-size: 14px;
    }

    .results th, .results td {
        padding: 6px;
    }

    .form-input {
        font-size: 16px;
        padding: 12px;
    }

    #qr-reader {
        margin: 10px auto;
    }
}

/* Estilos para la tabla de registro2.php */
.mobile-table {
    width: 100%;
}

@media screen and (max-width: 768px) {
    .mobile-table .hide-mobile {
        display: none;
    }

    .mobile-table .show-details-btn {
        padding: 5px 10px;
        background-color: #007BFF;
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
    }

    .mobile-table .show-details-btn:hover {
        background-color: #0056b3;
    }
}

#qr-reader__scan_region {
    border: 2px solid #0078D4;
    border-radius: 8px;
    animation: scan-border 2s infinite;
}

@keyframes scan-border {
    0% { box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.8); }
    100% { box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.5); }
}

/* Estilos para móvil */
@media screen and (max-width: 768px) {
    #form-container {
        width: 100%;
        max-width: none;
        min-height: 100vh;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    button {
        font-size: 20px;
        padding: 15px 20px;
    }

    .form-group input {
        font-size: 20px;
    }

    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        width: 100%;
    }

    .header-container h1 {
        margin: 0;
        flex-grow: 1;
    }

    .btn-competidores {
        background-color: #007bff;
        color: white;
        padding: 10px 20px;
        border-radius: 5px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-weight: 500;
        transition: background-color 0.3s ease;
    }
    
    .btn-competidores:hover {
        background-color: #0056b3;
    }
    
    .btn-competidores i {
        font-size: 1.2em;
    }
    
    @media (max-width: 768px) {
        .btn-competidores {
            width: 100%;
            justify-content: center;
            margin-top: 10px;
        }
    }
}

/* Estilos cuando los resultados están visibles */
.results-visible #form-container {
    max-width: 600px;
    min-height: auto;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.autocomplete-suggestions {
    position: absolute;
    background: white;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 2px;
}

.autocomplete-suggestion {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.autocomplete-suggestion:hover {
    background-color: #f0f8ff;
}

.suggestion-code {
    font-weight: bold;
    color: #007bff;
    margin-right: 10px;
    min-width: 100px;
}

.suggestion-description {
    flex-grow: 1;
    color: #333;
}

/* Add these styles at the end of your style.css file */
#extra-fields {
    display: none;
}

.error {
    color: #dc3545;
    padding: 10px;
    border-radius: 4px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    margin-top: 10px;
}
