/**
 * Estilos para el nuevo flujo de captura de tickets
 * @package CV_Commissions
 * @since 1.2.0
 */

/* Modal de permisos */
.cv-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cv-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cv-modal-content h2 {
    margin: 0 0 20px;
    font-size: 24px;
    color: #333;
    text-align: center;
}

.cv-modal-content p {
    margin: 0 0 15px;
    color: #666;
    line-height: 1.6;
}

.cv-modal-content ol {
    margin: 0 0 20px 20px;
    padding: 0;
    color: #666;
}

.cv-modal-content ol li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.cv-modal-actions {
    margin-top: 25px;
}

.cv-checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

.cv-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.cv-checkbox-label span {
    font-size: 15px;
    color: #333;
}

/* Interfaz de cámara */
.cv-camera-interface {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99998;
}

.cv-camera-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cv-camera-container h2 {
    color: #fff;
    margin: 0 0 20px;
    font-size: 22px;
    text-align: center;
}

#cv-camera-video,
#cv-captured-image {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

#cv-captured-image {
    object-fit: contain;
}

.cv-camera-controls {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Formulario de ticket */
.cv-ticket-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 99997;
    overflow-y: auto;
    padding: 20px;
}

.cv-form-container {
    max-width: 600px;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cv-form-container h2 {
    margin: 0 0 25px;
    font-size: 24px;
    color: #333;
    text-align: center;
}

.cv-ticket-summary {
    margin-bottom: 30px;
}

.cv-summary-item {
    margin-bottom: 20px;
}

.cv-summary-item strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.cv-summary-item span {
    color: #666;
    font-size: 18px;
}

#cv-ticket-preview {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    margin-top: 10px;
}

.cv-amount-input label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.cv-amount-input input {
    width: 100%;
    padding: 12px 15px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
}

.cv-amount-input input:focus {
    outline: none;
    border-color: #667eea;
}

.cv-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Botones */
.cv-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cv-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cv-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    flex: 1;
}

.cv-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cv-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.cv-btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.cv-btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    flex: 2;
}

.cv-btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.cv-btn-danger {
    background: #dc3545;
    color: #fff;
    flex: 1;
}

.cv-btn-danger:hover:not(:disabled) {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .cv-modal-content {
        padding: 20px;
    }
    
    .cv-modal-content h2 {
        font-size: 20px;
    }
    
    .cv-camera-container h2 {
        font-size: 18px;
    }
    
    #cv-camera-video,
    #cv-captured-image {
        max-height: 50vh;
    }
    
    .cv-camera-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .cv-camera-controls .cv-btn {
        width: 100%;
    }
    
    .cv-form-container {
        padding: 20px;
    }
    
    .cv-form-container h2 {
        font-size: 20px;
    }
    
    .cv-form-actions {
        flex-direction: column;
    }
    
    .cv-form-actions .cv-btn {
        width: 100%;
    }
}

/* Loading spinner (opcional) */
.cv-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: cv-spin 1s ease-in-out infinite;
}

@keyframes cv-spin {
    to { transform: rotate(360deg); }
}

/* Animaciones de entrada */
@keyframes cvFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cv-modal-content {
    animation: cvFadeIn 0.3s ease-out;
}

/* === Formulario de Autenticación === */
.cv-auth-form {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cv-auth-form .cv-form-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.cv-auth-form h2 {
    margin: 0 0 20px 0;
    text-align: center;
    color: #333;
    font-size: 24px;
}

/* Mensaje de bienvenida y beneficios */
.cv-auth-welcome {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 8px;
    border: 2px solid #667eea30;
}

.cv-auth-intro {
    margin: 0 0 15px 0;
    text-align: center;
    color: #555;
    font-size: 15px;
}

.cv-auth-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.cv-benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
}

.cv-benefit-icon {
    font-size: 20px;
}

.cv-register-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f4f8;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.cv-register-info p {
    margin: 0 0 8px 0;
}

.cv-register-info p:last-child {
    margin-bottom: 0;
}

.cv-info-text {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.cv-auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.cv-auth-tab {
    flex: 1;
    padding: 12px;
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cv-auth-tab:hover {
    background: #e8e8e8;
}

.cv-auth-tab.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.cv-auth-mode {
    animation: cvFadeIn 0.3s ease-out;
}

.cv-auth-field {
    margin-bottom: 20px;
}

.cv-auth-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.cv-auth-field .required {
    color: #e74c3c;
}

.cv-auth-field input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cv-auth-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cv-auth-field small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.cv-auth-form .cv-form-actions {
    margin-top: 25px;
}

/* Pantalla de validación pendiente */
.cv-validation-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.cv-validation-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: cvSlideIn 0.4s ease-out;
    color: #fff;
}

.cv-validation-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: cvBounce 1s ease-in-out infinite;
}

.cv-validation-container h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #fff;
}

.cv-validation-message {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
}

.cv-validation-info {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.cv-validation-info p {
    margin-bottom: 15px;
    color: #fff;
    font-size: 15px;
}

.cv-validation-phone-display {
    font-size: 24px !important;
    font-weight: 700;
    color: #fff !important;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 15px 0 25px 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cv-validation-phone-display .wcfmfa {
    font-size: 28px;
}

.cv-validation-steps {
    margin: 25px 0;
    text-align: left;
}

.cv-validation-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 10px;
}

.cv-step-number {
    width: 36px;
    height: 36px;
    background: #fff;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.cv-step-text {
    font-size: 16px;
    font-weight: 500;
}

.cv-validation-note {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    font-size: 14px !important;
    margin: 20px 0 !important;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
}

.cv-validation-note .wcfmfa {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}

.cv-validation-benefits {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    font-size: 15px !important;
    line-height: 1.8;
    margin: 20px 0 0 0 !important;
}

.cv-validation-benefits strong {
    display: block;
    margin-bottom: 10px;
    font-size: 17px;
}

#cv-validation-ok {
    margin-top: 10px;
    background: #fff !important;
    color: #667eea !important;
    font-weight: 700;
    padding: 16px 40px;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#cv-validation-ok:hover {
    background: #f0f0f0 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
    .cv-auth-form .cv-form-container {
        padding: 20px;
        max-width: 100%;
    }
    
    .cv-auth-benefits {
        grid-template-columns: 1fr;
    }
    
    .cv-auth-form h2 {
        font-size: 20px;
    }
    
    .cv-validation-container {
        padding: 25px;
    }
    
    .cv-validation-container h2 {
        font-size: 24px;
    }
    
    .cv-validation-phone-display {
        font-size: 20px !important;
    }
    
    .cv-validation-icon {
        font-size: 60px;
    }
}

