/* ========================================
   Visor Público de Registros
   Estilos para la vista pública
   ======================================== */

/* Reset de Box Sizing para todos los elementos del visor */
.frp-visor-container *,
.frp-visor-container *::before,
.frp-visor-container *::after {
    box-sizing: border-box;
}

/* Contenedor Principal */
.frp-visor-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Login/Acceso */
.frp-visor-login {
    max-width: 500px;
    margin: 3rem auto;
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.frp-visor-login h2 {
    color: #1f2937;
    margin: 0 0 1rem 0;
    font-size: 1.875rem;
}

.frp-visor-login p {
    color: #6b7280;
    margin-bottom: 2rem;
}

.frp-token-form {
    text-align: left;
}

.frp-token-form .frp-form-group {
    margin-bottom: 1.5rem;
}

.frp-token-form label {
    display: block;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

/* Header del Visor */
.frp-visor-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 12px;
    color: white;
}

.frp-visor-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    color: white;
}

.frp-visor-stats {
    font-size: 1.125rem;
    margin: 0;
    opacity: 0.95;
}

.frp-visor-stats strong {
    font-weight: 700;
}

/* Grid de Tarjetas */
.frp-visor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Tarjeta Individual */
.frp-visor-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.frp-visor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Header de Tarjeta */
.frp-card-header {
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2563eb;
}

.frp-card-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: #1f2937;
    font-weight: 600;
}

.frp-card-id {
    background: #2563eb;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Body de Tarjeta */
.frp-card-body {
    padding: 1.25rem;
}

/* Imagen del Ticket */
.frp-card-image {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.frp-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.frp-card-image:hover img {
    transform: scale(1.05);
}

/* Información de la Tarjeta */
.frp-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.frp-info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 6px;
}

.frp-info-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
    min-width: 80px;
}

.frp-info-value {
    color: #1f2937;
    font-size: 0.875rem;
    text-align: right;
    word-break: break-word;
}

/* Paginación */
.frp-visor-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.frp-pag-btn {
    padding: 0.75rem 1.5rem;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
}

.frp-pag-btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: white;
}

.frp-pag-info {
    font-weight: 600;
    color: #1f2937;
    padding: 0.75rem 1rem;
}

/* Estado Vacío */
.frp-visor-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.frp-visor-empty p {
    color: #6b7280;
    font-size: 1.125rem;
    margin: 0;
}

/* Error */
.frp-visor-error {
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem;
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 12px;
    text-align: center;
}

.frp-visor-error p {
    color: #991b1b;
    font-weight: 500;
    margin: 0;
}

/* Responsive - Móviles */
@media (max-width: 639px) {
    .frp-visor-container {
        padding: 0 0.5rem;
    }
    
    .frp-visor-login {
        padding: 1.5rem;
        margin: 2rem auto;
    }
    
    .frp-visor-header {
        padding: 1.5rem 1rem;
    }
    
    .frp-visor-header h2 {
        font-size: 1.5rem;
    }
    
    .frp-visor-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .frp-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .frp-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .frp-info-value {
        text-align: left;
    }
    
    .frp-visor-pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .frp-pag-btn {
        width: 100%;
        text-align: center;
    }
}

/* Tablets */
@media (min-width: 640px) and (max-width: 1023px) {
    .frp-visor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Grande */
@media (min-width: 1024px) {
    .frp-visor-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animaciones */
@keyframes frp-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.frp-visor-card {
    animation: frp-fadeInUp 0.4s ease;
}

.frp-visor-card:nth-child(1) { animation-delay: 0.05s; }
.frp-visor-card:nth-child(2) { animation-delay: 0.1s; }
.frp-visor-card:nth-child(3) { animation-delay: 0.15s; }
.frp-visor-card:nth-child(4) { animation-delay: 0.2s; }
.frp-visor-card:nth-child(5) { animation-delay: 0.25s; }
.frp-visor-card:nth-child(6) { animation-delay: 0.3s; }

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .frp-visor-card,
    .frp-visor-login,
    .frp-visor-empty {
        background: #1f2937;
    }
    
    .frp-card-header {
        background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    }
    
    .frp-card-header h3,
    .frp-info-value {
        color: #f9fafb;
    }
    
    .frp-info-item {
        background: #374151;
    }
    
    .frp-visor-login h2 {
        color: #f9fafb;
    }
}
