/* Estilos para el frontend del plugin Cuponera */

/* Reset y estilos base */
.cuponera-verificacion * {
    box-sizing: border-box;
}

/* Contenedor principal */
.cuponera-verificacion {
    min-height: 100vh;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cuponera-container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.cuponera-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-content {
    position: relative;
    z-index: 2;
}

.cuponera-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.cuponera-header h1 {
    margin: 0 0 1rem 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.cuponera-header p {
    margin: 0;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    opacity: 0.9;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

/* Formulario de verificación */
.cuponera-verification-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #999;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Botón de verificar */
.btn-verificar {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-verificar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-verificar:hover::before {
    left: 100%;
}

.btn-verificar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-verificar:active {
    transform: translateY(0);
}

.btn-verificar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-size: 1rem;
}

/* Resultado de verificación */
.cuponera-resultado {
    padding: 2rem;
    margin: 0 2rem;
    border-radius: 15px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.cuponera-resultado.valido {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
}

.cuponera-resultado.invalido {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(244, 67, 54, 0.3);
}

.cupon-resultado-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cupon-resultado-content h3 {
    margin: 0;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 700;
}

.cupon-details {
    background: rgba(255,255,255,0.2);
    padding: 1.5rem;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.cupon-details .detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

.cupon-details .detail-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.cupon-details .detail-row span:first-child {
    font-weight: 600;
}

/* Formulario de cliente */
.cuponera-formulario-cliente {
    padding: 2rem;
    background: #f8f9fa;
    animation: slideUp 0.6s ease-out 0.2s both;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cuponera-formulario-cliente h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 600;
}

.cuponera-formulario-cliente p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Botón de registrar */
.btn-registrar {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-registrar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-registrar:hover::before {
    left: 100%;
}

.btn-registrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.3);
}

.btn-registrar:active {
    transform: translateY(0);
}

.btn-registrar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Animación de carga */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive mejorado */
@media (min-width: 768px) {
    .cuponera-verificacion {
        padding: 2rem;
    }
    
    .input-wrapper {
        flex-direction: row;
        gap: 1rem;
    }
    
    .form-group input {
        flex: 1;
    }
    
    .btn-verificar {
        width: auto;
        min-width: 200px;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .cuponera-verificacion {
        padding: 0.5rem;
        min-height: 100vh;
    }
    
    .cuponera-container {
        border-radius: 15px;
        margin: 0;
    }
    
    .cuponera-header {
        padding: 2rem 1.5rem;
    }
    
    .cuponera-verification-form {
        padding: 1.5rem;
    }
    
    .cuponera-resultado {
        margin: 0 1rem;
        padding: 1.5rem;
    }
    
    .cuponera-formulario-cliente {
        padding: 1.5rem;
    }
    
    .cupon-details {
        padding: 1rem;
    }
    
    .cupon-details .detail-row {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
        font-size: 0.85rem;
    }
    
    .btn-verificar,
    .btn-registrar {
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .btn-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cuponera-verificacion {
        padding: 0.25rem;
    }
    
    .cuponera-header {
        padding: 1.5rem 1rem;
    }
    
    .cuponera-verification-form,
    .cuponera-formulario-cliente {
        padding: 1rem;
    }
    
    .cuponera-resultado {
        margin: 0 0.5rem;
        padding: 1rem;
    }
    
    .form-group input {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
    
    .btn-verificar,
    .btn-registrar {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
    
    .btn-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 360px) {
    .cuponera-header h1 {
        font-size: 1.5rem;
    }
    
    .cuponera-header p {
        font-size: 0.85rem;
    }
    
    .cuponera-verification-form,
    .cuponera-formulario-cliente {
        padding: 0.75rem;
    }
    
    .form-group input {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn-verificar,
    .btn-registrar {
        padding: 0.625rem;
        font-size: 0.85rem;
    }
}

/* Mejoras de accesibilidad */
.btn-verificar:focus,
.btn-registrar:focus,
.form-group input:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Estados de error */
.form-group.error input {
    border-color: #f44336;
    background: #ffebee;
}

.form-group.error .error-message {
    color: #f44336;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Mejoras visuales adicionales */
.cuponera-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Efectos de hover en detalles */
.cupon-details .detail-row:hover {
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    transition: background 0.3s ease;
}

/* Mejoras en los inputs */
.form-group input {
    position: relative;
}

.form-group input:valid {
    border-color: #4CAF50;
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: #f44336;
}

/* Animación de éxito */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cuponera-resultado.valido {
    animation: successPulse 0.6s ease-out;
}

/* Mejoras para tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    .cuponera-container {
        max-width: 500px;
    }
    
    .cuponera-header {
        padding: 2.5rem 2rem;
    }
    
    .cuponera-verification-form,
    .cuponera-formulario-cliente {
        padding: 1.75rem;
    }
}

/* Mejoras para pantallas grandes */
@media (min-width: 1025px) {
    .cuponera-container {
        max-width: 650px;
    }
    
    .cuponera-header {
        padding: 3.5rem 2.5rem;
    }
    
    .cuponera-verification-form,
    .cuponera-formulario-cliente {
        padding: 2.5rem;
    }
}
