/* Real-time voucher validation styles */

.voucher-input-group {
    position: relative;
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

#voucher-code-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #444;
    border-radius: 8px;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

#voucher-code-input:focus {
    outline: none;
    border-color: #e50914;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

#voucher-code-input.valid {
    border-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

#voucher-code-input.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.3);
}

#redeem-voucher-button {
    padding: 12px 24px;
    background: #e50914;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#redeem-voucher-button:hover:not(:disabled) {
    background: #b8070f;
    transform: translateY(-2px);
}

#redeem-voucher-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#redeem-voucher-button.valid-voucher {
    background: #28a745;
    animation: pulse 2s infinite;
}

#redeem-voucher-button.valid-voucher:hover:not(:disabled) {
    background: #218838;
}

#redeem-voucher-button.loading {
    pointer-events: none;
}

#redeem-voucher-button .loader {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

#redeem-voucher-button.loading .button-text {
    display: none;
}

#redeem-voucher-button.loading .loader {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

#voucher-message {
    margin-top: 10px;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#voucher-message.success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #28a745;
}

#voucher-message.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #dc3545;
}

#voucher-message.validating {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ffc107;
}

#voucher-message.valid {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #28a745;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .voucher-input-group {
        flex-direction: column;
    }
    
    #redeem-voucher-button {
        width: 100%;
        margin-top: 10px;
    }
}

/* Loading state for input */
#voucher-code-input.validating {
    background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
