/* Tabla de Códigos Generados */
.view-codes {
    width: 90%;
    border-collapse: collapse;
    margin: 20px auto;
    font-size: 1em;
    text-align: left;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.view-codes th, .view-codes td {
    padding: 10px 15px;
    border: 1px solid #ddd;
    text-align: center;
}

.view-codes th {
    background-color: #007BFF;
    color: #fff;
}

.view-codes td a {
    color: #007BFF;
    text-decoration: none;
}

.view-codes td a:hover {
    text-decoration: underline;
}

.no-codes {
    text-align: center;
    font-style: italic;
    color: #777;
    padding: 20px;
    font-size: 1.2em;
}

/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Header */
header {
    background-color: #333;
    color: #fff;
    padding: 15px;
    text-align: center;
    font-size: 1.8em;
    font-weight: bold;
}

/* Buttons */
.button {
    margin-bottom: 10px;
    background-color: #007BFF;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.button:hover {
    background-color: #0056b3;
}

/* Footer */
footer {
    background-color: #f4f4f4;
    text-align: center;
    padding: 20px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 100;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    max-width: 150px;
    margin-top: 10px;
}

/* Gallery Styles */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.gallery ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.gallery li {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 150px;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    padding: 4px;
    z-index: 1;
}

.gallery img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    display: block;
    margin: auto;
    transition: transform 0.2s ease-in-out;
}

.gallery img:hover {
    transform: scale(1.05);
}

/* Botones de Favorito y usado*/
.actions {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
}

.favorite-button, .used-button {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.favorite-button {
    background-color: #FFD700;
    color: black;
}

.used-button {
    background-color: #32CD32;
    color: white;
}


/* Larger Image Preview */
.overlay {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 50;
    display: none;
}

.preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 100;
    background-color: white;
    border: 2px solid #ddd;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    z-index: 1000;
}

.preview img {
    width: 400px;
    height: auto;
    display: block;
    border-radius: 10px;
    z-index: 1000;
}

.gallery li:hover ~ .overlay,
.gallery li:hover .preview {
    display: block;
}

/* Loading Animation */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loading-overlay .spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007BFF;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* Media Queries para dispositivos móviles */
@media (max-width: 768px) {
    .gallery img {
        max-width: 120px;
        max-height: 120px;
    }
    .gallery li {
            margin: 5px; /* Menos espacio entre elementos */
        }
          .preview {
        display: none !important;
    }
    .button {
        padding: 8px 12px;
        font-size: 12px;
    }

    footer {
        padding: 15px;
        font-size: 0.9em;
    }
      .logo {
        max-width: 120px; /* Reduce el tamaño del logo */
    }
    header {
        padding: 10px; /* Reduce el padding */
        font-size: 1.5em; /* Reduce el tamaño del texto */
    }

            table {
                width: 100%;
                font-size: 14px;
            }
            th, td {
                padding: 8px 10px;
            }
 
  th {
                font-size: 12px; /* Reduce tamaño del texto de encabezados */
            }
            td {
                font-size: 11px; /* Reduce tamaño del texto de celdas */
            }

            img {
                max-width: 120px; /* Reduce tamaño del logo */
            }
}

@media (max-width: 480px) {
    .gallery img {
        max-width: 100px;
        max-height: 100px;
    }
    .gallery li {
            margin: 3px; /* Espacio mínimo entre miniaturas */
        }
          .preview {
        display: none !important;
    }
                  table {
                width: 80%;
                font-size: 8px;
            }
            th, td {
                padding: 6px 8px;
            }
            img {
                max-width: 120px;
            }
         table {
                width: 100%; /* Permite un scroll horizontal si es necesario */
                font-size: 10px; /* Reduce aún más el tamaño de texto */
            }
            th, td {
                padding: 5px 8px; /* Padding más pequeño */
            }
            th {
                font-size: 10px; /* Texto más pequeño para encabezados */
            }
            td {
                font-size: 9px; /* Texto más pequeño para celdas */
            }  
    .button {
        padding: 6px 10px;
        font-size: 10px;
    }

    .logo {
        max-width: 100px;
    }

    footer {
        padding: 10px;
        font-size: 0.8em;
    }

      header {
        padding: 8px; /* Aún más compacto */
        font-size: 1.2em; /* Ajuste del tamaño del texto */
    }
     img {
                max-width: 100px;
            }
}

