/* === General === */
body {
    font-family: 'Poppins', sans-serif;
    max-width: 100%;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease;
}

/* === Contenedor Principal === */
.container {
    max-width: 100%;
    margin: 40px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
}

/* === Encabezados === */
h2 {
    color: #212529;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    width: 50px;
    height: 3px;
    background-color: #007bff;
    display: block;
    margin: 8px auto 0;
    border-radius: 5px;
}

/* === Flash Messages === */
.flash-message {
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    border-left: 5px solid;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.flash-message.success {
    background-color: #eaf7ea;
    color: #155724;
    border-color: #28a745;
}

.flash-message.error {
    background-color: #fdecea;
    color: #721c24;
    border-color: #dc3545;
}

/* === Formulario === */
form {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

form label {
    font-weight: 500;
    color: #444;
    font-size: 16px;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
    outline: none;
}

form button {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease-in-out;
}

form button:hover {
    background: linear-gradient(45deg, #0056b3, #003f7f);
}

/* === Tablas === */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

th, td {
    padding: 14px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    transition: background-color 0.3s ease;
}

th {
    background: #007bff;
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

td {
    font-size: 14px;
    color: #444;
}

tr:hover td {
    background-color: #f1f1f1;
}

/* === Estados de Explosivos === */
.estado-disponible {
    color: #28a745;
    font-weight: bold;
}

.estado-vencido {
    color: #dc3545;
    font-weight: bold;
}

/* === Logo en Configuración === */
#logo-preview {
    max-width: 100%;
    max-height: 150px;
    display: block;
    margin: 10px auto;
    border-radius: 8px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3);
}

/* === Botón Escaneo === */
#scanBtn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    font-size: 16px;
    padding: 12px;
    border: none;
    cursor: pointer;
    width: 100%;
    border-radius: 6px;
    transition: all 0.3s;
}

#scanBtn:hover {
    background: linear-gradient(45deg, #0056b3, #003f7f);
}

/* === Contenedor del Escáner === */
#scanner-container {
    display: none;
    text-align: center;
    margin-top: 15px;
}

#scanner {
    width: 100%;
    max-width: 450px;
    height: auto;
    border: 3px solid #007bff;
    border-radius: 8px;
    box-shadow: 0px 0px 8px rgba(0, 123, 255, 0.3);
}

/* === Responsividad (Móviles) === */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 20px;
    }

    form {
        padding: 20px;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 12px;
    }

    form input,
    form select {
        font-size: 14px;
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 15px;
        margin: 15px;
    }

    form {
        padding: 15px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px;
    }

    form input,
    form select {
        font-size: 12px;
        padding: 8px;
    }

    form button {
        font-size: 14px;
        padding: 10px;
    }

    h2 {
        font-size: 24px;
    }

    #logo-preview {
        max-height: 120px;
    }
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Para hacer el desplazamiento más fluido en iOS */
    white-space: nowrap; /* Evita que el contenido se quiebre en líneas */
}


/* Clase personalizada para los recuadros */
.card-custom-size {
    height: 300px; /* Altura fija para todos los recuadros */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-custom-size img {
    object-fit: cover; /* Ajusta la imagen al tamaño del contenedor */
    height: 180px; /* Altura fija para las imágenes */
    width: 100%; /* Ancho completo */
}

.card-custom-size .card-body {
    flex-grow: 1; /* Hace que el cuerpo utilice el espacio restante */
    text-align: center; /* Centra el texto */
    padding: 10px; /* Espaciado interno */
}
.card-custom-size .card-title {
    font-size: 18px; /* Tamaño de fuente para el título */
    margin-bottom: 10px; /* Espacio debajo del título */
}
.card-custom-size .card-text {
    font-size: 14px; /* Tamaño de fuente para el texto */
    color: #555; /* Color del texto */
}
.card-custom-size img {
    cursor: pointer; /* Cambia el puntero al pasar sobre la imagen */
    transition: transform 0.2s; /* Efecto suave al pasar el mouse */
}

.card-custom-size img:hover {
    transform: scale(1.05); /* Amplía ligeramente la imagen al pasar el mouse */
}
